Package de.otto.synapse.eventsource
Class DefaultEventSource
java.lang.Object
de.otto.synapse.eventsource.AbstractEventSource
de.otto.synapse.eventsource.DefaultEventSource
- All Implemented Interfaces:
EventSource
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultEventSource(MessageStore messageStore, MessageLogReceiverEndpoint messageLog) DefaultEventSource(MessageStore messageStore, MessageLogReceiverEndpoint messageLog, org.slf4j.Marker marker) -
Method Summary
Modifier and TypeMethodDescriptionconsumeUntil(Predicate<ShardResponse> stopCondition) Consumes all messages from the EventSource until the predicate returns true.Methods inherited from class de.otto.synapse.eventsource.AbstractEventSource
getChannelName, getMessageDispatcher, getMessageLogReceiverEndpoint, isStopping, register, stopMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface de.otto.synapse.eventsource.EventSource
consume
-
Constructor Details
-
DefaultEventSource
public DefaultEventSource(@Nonnull MessageStore messageStore, @Nonnull MessageLogReceiverEndpoint messageLog) -
DefaultEventSource
public DefaultEventSource(@Nonnull MessageStore messageStore, @Nonnull MessageLogReceiverEndpoint messageLog, @Nonnull org.slf4j.Marker marker)
-
-
Method Details
-
consumeUntil
@Nonnull public CompletableFuture<ChannelPosition> consumeUntil(@Nonnull Predicate<ShardResponse> stopCondition) Description copied from interface:EventSourceConsumes all messages from the EventSource until the predicate returns true.The registered
consumerswill 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
-