public class OnceOffSchedule<T> extends java.lang.Object implements Reschedulable<T>
ReschedulingSink
to deliver messages to sink's consumers
exactly once.MessageRepeater
,
OnceOffRepeatConsumer
Constructor and Description |
---|
OnceOffSchedule(java.util.function.Consumer<T> consumer)
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
java.util.Optional<Schedule<T>> |
consume(CountedSchedule current,
T data)
Consumes the output of the channel this instance is bound to.
|
public OnceOffSchedule(java.util.function.Consumer<T> consumer)
consumer
- consumes the message output from the channel.java.lang.NullPointerException
- if the argument is null
.public java.util.Optional<Schedule<T>> consume(CountedSchedule current, T data)
Reschedulable
consume
in interface Reschedulable<T>
current
- information about this invocation's schedule.data
- the data received from the channel.null
.