@Internal public interface TimerService extends ProcessingTimeService
The registration of timers follows a life cycle of three phases:
ProcessingTimeService.quiesce()
, further calls to
ProcessingTimeService.registerTimer(long, ProcessingTimeCallback)
will not register any further timers, and will
return a "dummy" future as a result. This is used for clean shutdown, where currently firing
timers are waited for and no future timers can be scheduled, without causing hard exceptions.shutdownService()
, all calls to ProcessingTimeService.registerTimer(long, ProcessingTimeCallback)
will result in a hard exception.Modifier and Type | Method and Description |
---|---|
boolean |
isTerminated()
Returns true if the service has been shut down, false otherwise.
|
void |
shutdownService()
Shuts down and clean up the timer service provider hard and immediately.
|
boolean |
shutdownServiceUninterruptible(long timeoutMs)
Shuts down and clean up the timer service provider hard and immediately.
|
getCurrentProcessingTime, quiesce, registerTimer, scheduleAtFixedRate, scheduleWithFixedDelay
boolean isTerminated()
void shutdownService()
ProcessingTimeService.registerTimer(long, ProcessingTimeCallback)
will result in a hard exception.boolean shutdownServiceUninterruptible(long timeoutMs)
ProcessingTimeService.registerTimer(long, ProcessingTimeCallback)
will result in a hard exception. This call cannot be interrupted and will block until the shutdown is completed
or the timeout is exceeded.timeoutMs
- timeout for blocking on the service shutdown in milliseconds.Copyright © 2014–2020 The Apache Software Foundation. All rights reserved.