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
provides an implementation of [`EventHandler`](https://github.com/optimizely/java-sdk/blob/master/core-api/src/main/java/com/optimizely/ab/event/EventHandler.java)
@@ -97,18 +97,30 @@ memory if the workers cannot keep up with the production rate.
97
97
98
98
The number of workers determines the number of threads the thread pool uses.
99
99
100
+
### Builder Methods
101
+
The following builder methods can be used to custom configure the `AsyncEventHandler`.
102
+
103
+
|Method Name|Default Value|Description|
104
+
|---|---|---|
105
+
|`withQueueCapacity(int)`|10000|Queue size for pending logEvents|
106
+
|`withNumWorkers(int)`|2|Number of worker threads|
107
+
|`withMaxTotalConnections(int)`|200|Maximum number of connections|
108
+
|`withMaxPerRoute(int)`|20|Maximum number of connections per route|
109
+
|`withValidateAfterInactivity(int)`|5000|Time to maintain idol connections (in milliseconds)|
110
+
100
111
### Advanced configuration
112
+
The following properties can be set to override the default configuration.
101
113
102
114
|Property Name|Default Value|Description|
103
115
|---|---|---|
104
-
|`async.event.handler.queue.capacity`|10000|Queue size for pending logEvents|
105
-
|`async.event.handler.num.workers`|2|Number of worker threads|
106
-
|`async.event.handler.max.connections`|200|Maximum number of connections|
107
-
|`async.event.handler.event.max.per.route`|20|Maximum number of connections per route|
108
-
|`async.event.handler.validate.after`|5000|Time to maintain idol connections (in milliseconds)|
116
+
|**async.event.handler.queue.capacity**|10000|Queue size for pending logEvents|
117
+
|**async.event.handler.num.workers**|2|Number of worker threads|
118
+
|**async.event.handler.max.connections**|200|Maximum number of connections|
119
+
|**async.event.handler.event.max.per.route**|20|Maximum number of connections per route|
120
+
|**async.event.handler.validate.after**|5000|Time to maintain idol connections (in milliseconds)|
is an implementation of the abstract [`PollingProjectConfigManager`](https://github.com/optimizely/java-sdk/blob/master/core-api/src/main/java/com/optimizely/ab/config/PollingProjectConfigManager.java).
@@ -139,20 +151,49 @@ The polling interval is used to specify a fixed delay between consecutive HTTP r
139
151
#### Initial datafile
140
152
141
153
You can provide an initial datafile via the builder to bootstrap the `ProjectConfigManager` so that it can be used
142
-
immediately without blocking execution.
154
+
immediately without blocking execution. The initial datafile also serves as a fallback datafile if HTTP connection
155
+
cannot be established. This is useful in mobile environments, where internet connectivity is not guaranteed.
156
+
The initial datafile will be discarded after the first successful datafile poll.
157
+
158
+
### Builder Methods
159
+
The following builder methods can be used to custom configure the `HttpProjectConfigManager`.
160
+
161
+
|Builder Method|Default Value|Description|
162
+
|---|---|---|
163
+
|`withDatafile(String)`|null|Initial datafile, typically sourced from a local cached source.|
164
+
|`withUrl(String)`|null|URL override location used to specify custom HTTP source for the Optimizely datafile.|
165
+
|`withFormat(String)`|https://cdn.optimizely.com/datafiles/%s.json|Parameterized datafile URL by SDK key.|
166
+
|`withPollingInterval(Long, TimeUnit)`|5 minutes|Fixed delay between fetches for the datafile.|
167
+
|`withBlockingTimeout(Long, TimeUnit)`|10 seconds|Maximum time to wait for initial bootstrapping.|
168
+
|`withSdkKey(String)`|null|Optimizely project SDK key. Required unless source URL is overridden.|
143
169
144
170
### Advanced configuration
171
+
The following properties can be set to override the default configuration.
145
172
146
173
|Property Name|Default Value|Description|
147
174
|---|---|---|
148
-
|`http.project.config.manager.polling.duration`|5|Fixed delay between fetches for the datafile|
149
-
|`http.project.config.manager.polling.unit`|MINUTES|Time unit corresponding to polling interval|
150
-
|`http.project.config.manager.blocking.duration`|10|Maximum time to wait for initial bootstrapping|
151
-
|`http.project.config.manager.blocking.unit`|SECONDS|Time unit corresponding to blocking duration|
In this package, [`OptimizelyFactory`](https://github.com/optimizely/java-sdk/blob/master/core-httpclient-impl/src/main/java/com/optimizely/ab/OptimizelyFactory.java)
174
215
provides basic utility to instantiate the Optimizely SDK with a minimal number of configuration options.
0 commit comments