| Constructor and Description |
|---|
Timer(@NotNull EventLoop eventLoop)
Constructs a Timer with the default system time provider.
|
Timer(@NotNull EventLoop eventLoop,
@NotNull TimeProvider timeProvider)
Constructs a Timer with a specified time provider.
|
| Modifier and Type | Method and Description |
|---|---|
void |
schedule(@NotNull Runnable eventHandler,
long delay)
Schedule
eventHandler to run once after delay milliseconds. |
void |
scheduleAtFixedRate(@NotNull VanillaEventHandler eventHandler,
long initialDelay,
long period)
Schedules
eventHandler to run at a fixed-rate on the event loop. |
void |
scheduleAtFixedRate(@NotNull VanillaEventHandler eventHandler,
long initialDelay,
long period,
HandlerPriority priority)
Schedules
eventHandler to run at a fixed-rate on the event loop. |
public Timer(@NotNull
@NotNull EventLoop eventLoop)
eventLoop - The event loop on which the timer tasks are scheduled and run.public Timer(@NotNull
@NotNull EventLoop eventLoop,
@NotNull
@NotNull TimeProvider timeProvider)
eventLoop - The event loop on which the timer tasks are scheduled and run.timeProvider - The time provider used to control the scheduling.public void scheduleAtFixedRate(@NotNull
@NotNull VanillaEventHandler eventHandler,
long initialDelay,
long period)
eventHandler to run at a fixed-rate on the event loop.
Timing is best-effort and any delay does not trigger multiple catch-up
invocations. The underlying call returns a Closeable;
closing it aborts future executions.eventHandler - The handler to be invoked.initialDelay - first wait in milliseconds before the handler runs.period - interval in milliseconds between executions.public void scheduleAtFixedRate(@NotNull
@NotNull VanillaEventHandler eventHandler,
long initialDelay,
long period,
HandlerPriority priority)
eventHandler to run at a fixed-rate on the event loop.
Timing is best-effort and any delay does not trigger multiple catch-up
invocations. The underlying call returns a Closeable;
closing it aborts future executions.eventHandler - The handler to be invoked.initialDelay - first wait in milliseconds before the handler runs.period - interval in milliseconds between executions.priority - The priority of the event handler.public void schedule(@NotNull
@NotNull Runnable eventHandler,
long delay)
eventHandler to run once after delay milliseconds.
Internally an InvalidEventHandlerException is thrown after the
execution to remove the handler.eventHandler - The handler to be invoked once.delay - how long in milliseconds to wait before the handler runs.Copyright © 2026 Chronicle Software Ltd. All rights reserved.