Class DefaultEventSource

    • Method Detail

      • 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