Class NonBlockingFiniteStateMachine.CoalescedEvent<S extends Enum<S>>

java.lang.Object
com.tangosol.util.fsm.NonBlockingFiniteStateMachine.CoalescedEvent<S>
Type Parameters:
S - the type of the state for the FiniteStateMachine
All Implemented Interfaces:
Event<S>, LifecycleAwareEvent<S>
Enclosing class:
NonBlockingFiniteStateMachine<S extends Enum<S>>

public static class NonBlockingFiniteStateMachine.CoalescedEvent<S extends Enum<S>> extends Object implements LifecycleAwareEvent<S>
A NonBlockingFiniteStateMachine.CoalescedEvent is a LifecycleAwareEvent that coalesces other (wrapped) Events with the same discriminator so that only one Event actually executes.

For example: Given 10 Events submitted to a NonBlockingFiniteStateMachine with the same discriminator, only one of the said Events will be processed. All others will be discarded. Once the NonBlockingFiniteStateMachine.CoalescedEvent has been processed, a new batch may be created when another NonBlockingFiniteStateMachine.CoalescedEvent of the same discriminator is submitted.

The actual Event processed depends on the mode of coalescing required. The first NonBlockingFiniteStateMachine.CoalescedEvent submitted to a NonBlockingFiniteStateMachine for a specific discriminator effectively starts the coalescing of Events for the said discriminator. When the mode is set to NonBlockingFiniteStateMachine.CoalescedEvent.Process.FIRST, then the first Event (starting the coalescing) will be processed and others will be discarded. When the mode is set of NonBlockingFiniteStateMachine.CoalescedEvent.Process.MOST_RECENT then the most recently submitted Event will be processed and likewise, all others for the same discriminator will be discarded.