public static class BatchEventProcessor.Builder
extends java.lang.Object
| Constructor and Description |
|---|
Builder() |
| Modifier and Type | Method and Description |
|---|---|
BatchEventProcessor |
build() |
BatchEventProcessor |
build(boolean shouldStart) |
BatchEventProcessor.Builder |
withBatchSize(java.lang.Integer batchSize)
BatchSize is the maximum number of events contained within a single event batch.
|
BatchEventProcessor.Builder |
withEventHandler(EventHandler eventHandler)
EventHandler implementation used to dispatch events to Optimizely. |
BatchEventProcessor.Builder |
withEventQueue(java.util.concurrent.BlockingQueue<java.lang.Object> eventQueue)
EventQueue is the underlying BlockingQueue used to buffer events before being added to the batch payload.
|
BatchEventProcessor.Builder |
withExecutor(java.util.concurrent.ExecutorService executor)
ExecutorService used to execute the
BatchEventProcessor.EventConsumer thread. |
BatchEventProcessor.Builder |
withFlushInterval(java.lang.Long flushInterval)
FlushInterval is the maximum duration, in milliseconds, that an event will remain in flight before
being flushed to the event dispatcher.
|
BatchEventProcessor.Builder |
withNotificationCenter(NotificationCenter notificationCenter)
NotificationCenter used to notify when event batches are flushed.
|
BatchEventProcessor.Builder |
withTimeout(long duration,
java.util.concurrent.TimeUnit timeUnit)
Timeout is the maximum time to wait for the EventProcessor to close.
|
public BatchEventProcessor.Builder withEventHandler(EventHandler eventHandler)
EventHandler implementation used to dispatch events to Optimizely.eventHandler - The event handlerpublic BatchEventProcessor.Builder withEventQueue(java.util.concurrent.BlockingQueue<java.lang.Object> eventQueue)
eventQueue - The event queuepublic BatchEventProcessor.Builder withBatchSize(java.lang.Integer batchSize)
batchSize - The batch sizepublic BatchEventProcessor.Builder withFlushInterval(java.lang.Long flushInterval)
flushInterval - The flush intervalpublic BatchEventProcessor.Builder withExecutor(java.util.concurrent.ExecutorService executor)
BatchEventProcessor.EventConsumer thread.executor - The ExecutorServicepublic BatchEventProcessor.Builder withTimeout(long duration, java.util.concurrent.TimeUnit timeUnit)
duration - The max time to wait for the EventProcessor to closetimeUnit - The time unitpublic BatchEventProcessor.Builder withNotificationCenter(NotificationCenter notificationCenter)
notificationCenter - The NotificationCenterpublic BatchEventProcessor build()
public BatchEventProcessor build(boolean shouldStart)