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)
72
+
backed by a `ThreadPoolExecutor`. Events triggered from the Optimizely SDK are queued immediately as discrete tasks to
73
+
the executor and processed in the order they were submitted.
72
74
73
-
The [`AsyncEventHandler`](https://github.com/optimizely/java-sdk/blob/master/core-httpclient-impl/src/main/java/com/optimizely/ab/event/AsyncEventHandler.java)
74
-
provides an implementation of the the [`EventHandler`](https://github.com/optimizely/java-sdk/blob/master/core-api/src/main/java/com/optimizely/ab/event/EventHandler.java)
75
-
backed by a `ThreadPoolExecutor`. When events are
76
-
triggered from the Optimizely SDK, they are immediately queued as discrete tasks to the executor and processed in the
77
-
order they were submitted. Each worker is responsible for making outbound http requests to the
78
-
Optimizely log endpoint for metric tracking. The default queue size and the number of workers are configurable via
79
-
global properties and can be overridden via the `AsyncEventHandler.Builder`.
75
+
Each worker is responsible for making outbound HTTP requests to the Optimizely log endpoint for metrics tracking.
76
+
Configure the default queue size and number of workers via global properties. Use `AsyncEventHandler.Builder` to
77
+
override the default queue size and number of workers.
80
78
81
-
### Usage
79
+
### Use `AsyncEventHandler`
82
80
83
-
To use the AsyncEventHandler, an instance must be built via the`AsyncEventHandler.Builder`then passed to the `Optimizely.Builder`
81
+
To use `AsyncEventHandler`, you must build an instance with`AsyncEventHandler.Builder`and pass the instance to the `Optimizely.Builder`:
The queue capacity can be set to initialize the backing queue for the executor service. If the queue fills up, then
95
-
events will be dropped and exception will be logged. Setting a higher queue value will prevent event loss, but will
96
-
use up more memory in the event the workers can not keep up if the production rate.
92
+
You can set the queue capacity to initialize the backing queue for the executor service. If the queue fills up, events
93
+
will be dropped and an exception will be logged. Setting a higher queue value will prevent event loss but will use more
94
+
memory if the workers cannot keep up with the production rate.
97
95
98
96
#### Number of workers
99
97
100
-
The number of workers determines the number of threads used by the thread pool.
98
+
The number of workers determines the number of threads the thread pool uses.
101
99
102
-
####Advanced configurations
100
+
### Advanced configuration
103
101
104
102
|Property Name|Default Value|Description|
105
103
|---|---|---|
106
-
|async.event.handler.queue.capacity|10000|Queue size for pending LogEvents|
107
-
|async.event.handler.num.workers|2|Number of worker threads|
108
-
|async.event.handler.max.connections|200|Max number of connections|
109
-
|async.event.handler.event.max.per.route|20|Max number of connections per route|
110
-
|async.event.handler.validate.after|5000|Time in milliseconds to maintain idol connections|
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)|
111
109
112
110
113
-
## HttpProjectConfigManager
111
+
## `HttpProjectConfigManager`
114
112
115
-
The [`HttpProjectConfigManager`](https://github.com/optimizely/java-sdk/blob/master/core-httpclient-impl/src/main/java/com/optimizely/ab/config/HttpProjectConfigManager.java)
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).
117
-
The `poll` method is extended and makes an http GET request to the configured url to asynchronously download the project data file
118
-
and initialize an instance of the ProjectConfig. By default, the `HttpProjectConfigManager` will block until the
119
-
first successful retrieval of the datafile, up to a configurable timeout. The frequency of the polling method and the
120
-
blocking timeout can be set via the `HttpProjectConfigManager.Builder` with the default values being pulled from global
121
-
properties.
115
+
The `poll` method is extended and makes an HTTP GET request to the configured URL to asynchronously download the
116
+
project datafile and initialize an instance of the ProjectConfig.
122
117
123
-
### Usage
118
+
By default, `HttpProjectConfigManager` will block until the first successful datafile retrieval, up to a configurable timeout.
119
+
Set the frequency of the polling method and the blocking timeout with `HttpProjectConfigManager.Builder`,
120
+
pulling the default values from global properties.
The [`OptimizelyFactory`](https://github.com/optimizely/java-sdk/blob/master/core-httpclient-impl/src/main/java/com/optimizely/ab/OptimizelyFactory.java)
174
-
included in this package provides basic utility to instantiate the Optimizely SDK
175
-
with a minimal number of provided configuration options. Configuration properties are sourced from Java system properties,
176
-
environment variables or from an `optimizely.properties` file, in that order. Not all configuration and initialization
177
-
are captured via the `OptimizelyFactory`, for those use cases the resources can be built via their respective builder
178
-
classes.
171
+
## `OptimizelyFactory`
172
+
173
+
In this package, [`OptimizelyFactory`](https://github.com/optimizely/java-sdk/blob/master/core-httpclient-impl/src/main/java/com/optimizely/ab/OptimizelyFactory.java)
174
+
provides basic utility to instantiate the Optimizely SDK with a minimal number of configuration options.
175
+
Configuration properties are sourced from Java system properties, environment variables, or an
176
+
`optimizely.properties` file, in that order.
177
+
178
+
`OptimizelyFactory` does not capture all configuration and initialization options. For more use cases,
179
+
build the resources via their respective builder classes.
180
+
181
+
### Use `OptimizelyFactory`
179
182
180
-
### Usage
181
-
The SDK key is required to be provided at runtime either directly via the factory method:
183
+
You must provide the SDK key at runtime, either directly via the factory method:
0 commit comments