public interface TimerService
| Modifier and Type | Interface and Description |
|---|---|
static interface |
TimerService.TimerHandler
Called from the
poll(long). |
static interface |
TimerService.TimerSnapshotTaker
Called from the
snapshot(TimerSnapshotTaker). |
| Modifier and Type | Field and Description |
|---|---|
static int |
POLL_LIMIT
Max number of the timers to expire per single
poll(long). |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancelTimerByCorrelationId(long correlationId)
Cancels timer by its
correlationId. |
void |
currentTime(long now)
Set the current time from the Cluster in case the underlying implementation depends on it.
|
int |
poll(long now)
Poll for expired timers.
|
void |
scheduleTimerForCorrelationId(long correlationId,
long deadline)
Schedule timer with the given
correlationId and deadline. |
void |
snapshot(TimerService.TimerSnapshotTaker snapshotTaker)
Takes a snapshot of the timer service state, i.e.
|
static final int POLL_LIMIT
poll(long).int poll(long now)
TimerService.TimerHandler.onTimerEvent(long) on the
TimerService.TimerHandler that was provided upon creation of this TimerService instance.
Poll can be terminated early if POLL_LIMIT is reached or if TimerService.TimerHandler.onTimerEvent(long)
returns false.now - current time.POLL_LIMIT.void scheduleTimerForCorrelationId(long correlationId,
long deadline)
correlationId and deadline.correlationId - to associate with the timer.deadline - when the timer expires.boolean cancelTimerByCorrelationId(long correlationId)
correlationId.correlationId - of the timer to cancel.true if the timer was cancelled.void snapshot(TimerService.TimerSnapshotTaker snapshotTaker)
snapshotTaker - to take a snapshot.void currentTime(long now)
now - the current time.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.