You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68Lines changed: 68 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -67,9 +67,77 @@ The Optimizely client object accepts the following plug-ins:
67
67
1.`IEventDispatcher` handles the HTTP requests to Optimizely. The default implementation is an asynchronous "fire and forget".
68
68
2.`ILogger` exposes a single method, Log, to record activity in the SDK. An example of a class to bridge the SDK's Log to Log4Net is provided in the Demo Application.
69
69
3.`IErrorHandler` allows you to implement custom logic when Exceptions are thrown. Note that Exception information is already included in the Log.
70
+
4.`ProjectConfigManager` exposes method for retrieving ProjectConfig instance. Examples include `FallbackProjectConfigManager` and `HttpProjectConfigManager`.
70
71
71
72
These are optional plug-ins and default behavior is implement if none are provided.
is an implementation of the abstract [`PollingProjectConfigManager`](https://github.com/optimizely/csharp-sdk/blob/master/OptimizelySDK/Config/PollingProjectConfigManager.cs).
98
+
The `Poll` method is extended and makes an HTTP GET request to the configured URL to asynchronously download the
99
+
project datafile and initialize an instance of the ProjectConfig.
100
+
101
+
By default, `HttpProjectConfigManager` will block until the first successful datafile retrieval, up to a configurable timeout.
102
+
Set the frequency of the polling method and the blocking timeout with `HttpProjectConfigManager.Builder`.
103
+
104
+
##### Use HttpProjectConfigManager
105
+
106
+
```
107
+
HttpProjectConfigManager httpManager = new HttpProjectConfigManager.Builder()
108
+
.WithSdkKey(sdkKey)
109
+
.WithPollingInterval(TimeSpan.FromMinutes(1))
110
+
.Build();
111
+
```
112
+
113
+
##### SDK key
114
+
115
+
The SDK key is used to compose the outbound HTTP request to the default datafile location on the Optimizely CDN.
116
+
117
+
##### Polling interval
118
+
119
+
The polling interval is used to specify a fixed delay between consecutive HTTP requests for the datafile. Between 1 to 4294967294 miliseconds is valid duration. Otherwise default 5 minutes will be used.
120
+
121
+
##### Blocking Timeout Period
122
+
123
+
The blocking timeout period is used to specify a maximum time to wait for initial bootstrapping. Between 1 to 4294967294 miliseconds is valid blocking timeout period. Otherwise default value 15 seconds will be used.
124
+
125
+
##### Initial datafile
126
+
127
+
You can provide an initial datafile via the builder to bootstrap the `ProjectConfigManager` so that it can be used immediately without blocking execution.
128
+
129
+
##### URL
130
+
131
+
The URL is used to specify the location of datafile.
132
+
133
+
##### Format
134
+
135
+
This option enables user to provide a custom URL format to fetch the datafile.
136
+
137
+
##### Start by default
138
+
139
+
This option is used to specify whether to start the config manager on initialization.
0 commit comments