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

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      boolean onEvent​(T event, long sequence, boolean endOfBatch)
      Called for each event to consume it
    • Method Detail

      • onEvent

        boolean onEvent​(T event,
                        long sequence,
                        boolean endOfBatch)
                 throws java.lang.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:
        java.lang.Exception - any exceptions thrown by the handler will be propagated to the caller of poll