Class DefaultEventSource

java.lang.Object
de.otto.synapse.eventsource.AbstractEventSource
de.otto.synapse.eventsource.DefaultEventSource
All Implemented Interfaces:
EventSource

public class DefaultEventSource
extends AbstractEventSource
  • Constructor Details

  • Method Details

    • consumeUntil

      @Nonnull public java.util.concurrent.CompletableFuture<ChannelPosition> consumeUntil​(@Nonnull java.util.function.Predicate<ShardResponse> stopCondition)
      Description copied from interface: EventSource
      Consumes all messages from the EventSource until the predicate returns true.

      The registered consumers will be called zero or more times, depending on the number of messages retrieved from the EventSource.

      Parameters:
      stopCondition - the stop condition used to determine whether or not message-consumption should stop
      Returns:
      the new read position