Interface EventPoller.Handler<T>

Type Parameters:
T - the type of the event
Enclosing class:
EventPoller<T>

public static interface EventPoller.Handler<T>
A callback used to process events
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    onEvent(T event, long sequence, boolean endOfBatch)
    Called for each event to consume it
  • Method Details

    • onEvent

      boolean onEvent(T event, long sequence, boolean endOfBatch) throws Exception
      Called for each event to consume it
      Parameters:
      event - the event
      sequence - the sequence of the event
      endOfBatch - whether this event is the last in the batch
      Returns:
      whether to continue consuming events. If false, the poller will not feed any more events to the handler until EventPoller.poll(Handler) is called again
      Throws:
      Exception - any exceptions thrown by the handler will be propagated to the caller of poll