@Experimental(value=TIMERS) public interface Timer
TimeDomain for details on the time domains available.
Timer is specified by a
TimerSpec annotated with
An implementation of
Timer is implicitly scoped - it may be scoped to a key and
window, or a key, window, and trigger, etc.
A timer exists in one of two states: set or unset. A timer can be set only for a single time per scope.
Timer callbacks are not guaranteed to be called immediately according to the local view of the
TimeDomain, but will be called at some time after the requested time, in timestamp
|Modifier and Type||Method and Description|
Aligns the target timestamp used by
Offsets the target timestamp used by
Sets or resets the time in the timer's
Sets the timer relative to the current time, according to any offset and alignment specified.
void set(Instant absoluteTime)
TimeDomainat which it should fire. If the timer was already set, resets it to the new requested time.
TimeDomain.PROCESSING_TIME, the behavior is be unpredictable, since processing
time timers are ignored after a window has expired. Instead, it is recommended to use
Timer offset(Duration offset)
setRelative()by the given duration.
Timer align(Duration period)
setRelative()to the next boundary of