Class DebounceBatchStrategy

java.lang.Object
com.inductiveautomation.eventstream.gateway.stages.batch.BatchStrategy
com.inductiveautomation.eventstream.gateway.stages.batch.DebounceBatchStrategy

public class DebounceBatchStrategy extends BatchStrategy
Batches until any of the following conditions are met.
1. Debounce timer is hit. Debounce timer is reset every time a new event comes in.
2. Max wait timer is hit. Max wait timer resets on initial event and the first event following a batch forwarding.
3. Shutdown event received. Shutdown event aborts all pending events and then forwards the Shutdown event on a separate thread. A separate thread must be used to ensure the following stages still get the Shutdown event while they're in the middle of forwarding the last batch.

If a debounce timer or max wait timer is hit while the last batch is still being processed, the next batch will be immediately processed upon the previous batch's completion.

Tested are included with BatchStage.