11/*
2- * Copyright 2019-2020 , Optimizely
2+ * Copyright 2019-2021 , Optimizely
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use file except in compliance with the License.
@@ -35,6 +35,8 @@ public static class OptimizelyFactory
3535 {
3636 private static int MaxEventBatchSize ;
3737 private static TimeSpan MaxEventFlushInterval ;
38+ private static TimeSpan PollingInterval ;
39+ private static TimeSpan BlockingTimeOutPeriod ;
3840 private static ILogger OptimizelyLogger ;
3941 private const string ConfigSectionName = "optlySDKConfigSection" ;
4042
@@ -49,6 +51,16 @@ public static void SetFlushInterval(TimeSpan flushInterval)
4951 MaxEventFlushInterval = flushInterval ;
5052 }
5153
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+
5264 public static void SetLogger ( ILogger logger )
5365 {
5466 OptimizelyLogger = logger ;
@@ -76,7 +88,6 @@ public static Optimizely NewDefaultInstance()
7688 var eventDispatcher = new DefaultEventDispatcher ( logger ) ;
7789 var builder = new HttpProjectConfigManager . Builder ( ) ;
7890 var notificationCenter = new NotificationCenter ( ) ;
79-
8091 var configManager = builder
8192 . WithSdkKey ( httpProjectConfigElement . SDKKey )
8293 . WithUrl ( httpProjectConfigElement . Url )
@@ -111,7 +122,7 @@ public static Optimizely NewDefaultInstance()
111122 }
112123#endif
113124
114- public static Optimizely NewDefaultInstance ( string sdkKey )
125+ public static Optimizely NewDefaultInstance ( string sdkKey )
115126 {
116127 return NewDefaultInstance ( sdkKey , null ) ;
117128 }
@@ -128,6 +139,8 @@ public static Optimizely NewDefaultInstance(string sdkKey, string fallback, stri
128139 . WithSdkKey ( sdkKey )
129140 . WithDatafile ( fallback )
130141 . WithLogger ( logger )
142+ . WithPollingInterval ( PollingInterval )
143+ . WithBlockingTimeoutPeriod ( BlockingTimeOutPeriod )
131144 . WithErrorHandler ( errorHandler )
132145 . WithAccessToken ( datafileAuthToken )
133146 . WithNotificationCenter ( notificationCenter )
@@ -160,6 +173,8 @@ public static Optimizely NewDefaultInstance(string sdkKey, string fallback)
160173 . WithSdkKey ( sdkKey )
161174 . WithDatafile ( fallback )
162175 . WithLogger ( logger )
176+ . WithPollingInterval ( PollingInterval )
177+ . WithBlockingTimeoutPeriod ( BlockingTimeOutPeriod )
163178 . WithErrorHandler ( errorHandler )
164179 . WithNotificationCenter ( notificationCenter )
165180 . Build ( true ) ;
0 commit comments