1
1
/*
2
- * Copyright 2019-2020 , Optimizely
2
+ * Copyright 2019-2021 , Optimizely
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use file except in compliance with the License.
@@ -35,6 +35,8 @@ public static class OptimizelyFactory
35
35
{
36
36
private static int MaxEventBatchSize ;
37
37
private static TimeSpan MaxEventFlushInterval ;
38
+ private static TimeSpan PollingInterval ;
39
+ private static TimeSpan BlockingTimeOutPeriod ;
38
40
private static ILogger OptimizelyLogger ;
39
41
private const string ConfigSectionName = "optlySDKConfigSection" ;
40
42
@@ -49,6 +51,16 @@ public static void SetFlushInterval(TimeSpan flushInterval)
49
51
MaxEventFlushInterval = flushInterval ;
50
52
}
51
53
54
+ public static void SetPollingInterval ( TimeSpan pollingInterval )
55
+ {
56
+ PollingInterval = pollingInterval ;
57
+ }
58
+
59
+ public static void SetBlockingTimeOutPeriod ( TimeSpan blockingTimeOutPeriod )
60
+ {
61
+ BlockingTimeOutPeriod = blockingTimeOutPeriod ;
62
+ }
63
+
52
64
public static void SetLogger ( ILogger logger )
53
65
{
54
66
OptimizelyLogger = logger ;
@@ -76,7 +88,6 @@ public static Optimizely NewDefaultInstance()
76
88
var eventDispatcher = new DefaultEventDispatcher ( logger ) ;
77
89
var builder = new HttpProjectConfigManager . Builder ( ) ;
78
90
var notificationCenter = new NotificationCenter ( ) ;
79
-
80
91
var configManager = builder
81
92
. WithSdkKey ( httpProjectConfigElement . SDKKey )
82
93
. WithUrl ( httpProjectConfigElement . Url )
@@ -111,7 +122,7 @@ public static Optimizely NewDefaultInstance()
111
122
}
112
123
#endif
113
124
114
- public static Optimizely NewDefaultInstance ( string sdkKey )
125
+ public static Optimizely NewDefaultInstance ( string sdkKey )
115
126
{
116
127
return NewDefaultInstance ( sdkKey , null ) ;
117
128
}
@@ -128,6 +139,8 @@ public static Optimizely NewDefaultInstance(string sdkKey, string fallback, stri
128
139
. WithSdkKey ( sdkKey )
129
140
. WithDatafile ( fallback )
130
141
. WithLogger ( logger )
142
+ . WithPollingInterval ( PollingInterval )
143
+ . WithBlockingTimeoutPeriod ( BlockingTimeOutPeriod )
131
144
. WithErrorHandler ( errorHandler )
132
145
. WithAccessToken ( datafileAuthToken )
133
146
. WithNotificationCenter ( notificationCenter )
@@ -160,6 +173,8 @@ public static Optimizely NewDefaultInstance(string sdkKey, string fallback)
160
173
. WithSdkKey ( sdkKey )
161
174
. WithDatafile ( fallback )
162
175
. WithLogger ( logger )
176
+ . WithPollingInterval ( PollingInterval )
177
+ . WithBlockingTimeoutPeriod ( BlockingTimeOutPeriod )
163
178
. WithErrorHandler ( errorHandler )
164
179
. WithNotificationCenter ( notificationCenter )
165
180
. Build ( true ) ;
0 commit comments