| Modifier and Type | Class and Description |
|---|---|
protected static class |
CancellableTimer.ScheduledEventHandler |
| Constructor and Description |
|---|
CancellableTimer(@NotNull EventLoop eventLoop)
Constructs a CancellableTimer with the given event loop and system time provider.
|
CancellableTimer(@NotNull EventLoop eventLoop,
@NotNull TimeProvider timeProvider)
Constructs a CancellableTimer with the given event loop and custom time provider.
|
| Modifier and Type | Method and Description |
|---|---|
Closeable |
schedule(@NotNull Runnable eventHandler,
long delay)
Schedule
eventHandler to run once after delay milliseconds. |
Closeable |
scheduleAtFixedRate(@NotNull VanillaEventHandler eventHandler,
long initialDelay,
long period)
Schedules
eventHandler for fixed-rate execution on the event loop. |
Closeable |
scheduleAtFixedRate(@NotNull VanillaEventHandler eventHandler,
long initialDelay,
long period,
HandlerPriority priority)
Schedules
eventHandler for fixed-rate execution on the event loop. |
public CancellableTimer(@NotNull
@NotNull EventLoop eventLoop)
eventLoop - The event loop that the timer tasks will run on.public CancellableTimer(@NotNull
@NotNull EventLoop eventLoop,
@NotNull
@NotNull TimeProvider timeProvider)
eventLoop - The event loop that the timer tasks will run on.timeProvider - The custom time provider to use for scheduling.public Closeable scheduleAtFixedRate(@NotNull @NotNull VanillaEventHandler eventHandler, long initialDelay, long period)
eventHandler for fixed-rate execution on the event loop.
Timing is best-effort; missed runs are not queued.eventHandler - The handler to be invoked.initialDelay - first wait in milliseconds before the handler runs.period - interval in milliseconds between executions.Closeable that when closed aborts future executions.public Closeable scheduleAtFixedRate(@NotNull @NotNull VanillaEventHandler eventHandler, long initialDelay, long period, HandlerPriority priority)
eventHandler for fixed-rate execution on the event loop.
Timing is best-effort; missed runs are not queued.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.Closeable that when closed aborts future executions.public Closeable schedule(@NotNull @NotNull Runnable eventHandler, long delay)
eventHandler to run once after delay milliseconds.
After the task executes an InvalidEventHandlerException is thrown
internally to remove it from the event loop.eventHandler - The handler to be invoked once.delay - how long in milliseconds to wait before the handler runs.Closeable that when closed aborts future executions.Copyright © 2026 Chronicle Software Ltd. All rights reserved.