Interface TimerScheduler
-
Method Summary
Modifier and TypeMethodDescriptionCompletionStage
<akka.Done> Deprecated, for removal: This API element is subject to removal in a future version.<I,
O> void createSingleTimer
(String name, Duration delay, int maxRetries, DeferredCall<I, O> deferredCall) Schedule a single timer.<I,
O> void createSingleTimer
(String name, Duration delay, DeferredCall<I, O> deferredCall) Schedule a single timer.<I,
O> CompletionStage <akka.Done> createSingleTimerAsync
(String name, Duration delay, int maxRetries, DeferredCall<I, O> deferredCall) Schedule a single timer.<I,
O> CompletionStage <akka.Done> createSingleTimerAsync
(String name, Duration delay, DeferredCall<I, O> deferredCall) Schedule a single timer.void
Delete an existing timer.CompletionStage
<akka.Done> deleteAsync
(String name) Delete an existing timer.<I,
O> CompletionStage <akka.Done> startSingleTimer
(String name, Duration delay, int maxRetries, DeferredCall<I, O> deferredCall) Deprecated, for removal: This API element is subject to removal in a future version.<I,
O> CompletionStage <akka.Done> startSingleTimer
(String name, Duration delay, DeferredCall<I, O> deferredCall) Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Details
-
createSingleTimer
Schedule a single timer. Timers allow for scheduling calls in the future. For example, to verify that some process have been completed or not.Timers are persisted and are guaranteed to run at least once.
When a timer is triggered, the scheduled call is executed. If successfully executed, the timer completes and is automatically removed. In case of a failure, the timer is rescheduled with an exponentially increasing delay, starting at 3 seconds with a max delay of 30 seconds. This process repeats until the call succeeds.
Each timer has a
name
and if a new timer with samename
is registered the previous is cancelled.- Parameters:
name
- unique name for the timerdelay
- delay, starting from now, in which the timer should be triggereddeferredCall
- a call to component that will be executed when the timer is triggered
-
createSingleTimer
<I,O> void createSingleTimer(String name, Duration delay, int maxRetries, DeferredCall<I, O> deferredCall) Schedule a single timer. Timers allow for scheduling calls in the future. For example, to verify that some process have been completed or not.Timers are persisted and are guaranteed to run at least once.
When a timer is triggered, the scheduled call is executed. If successfully executed, the timer completes and is automatically removed. In case of a failure, the timer is rescheduled with a delay of 3 seconds. This process repeats until the call succeeds or the maxRetries limit is reached.
Each timer has a
name
and if a new timer with samename
is registered the previous is cancelled.- Parameters:
name
- unique name for the timerdelay
- delay, starting from now, in which the timer should be triggeredmaxRetries
- Retry up to this many times before giving updeferredCall
- a call to component that will be executed when the timer is triggered
-
delete
Delete an existing timer. This completes successfully if no timer is registered for the passed name. -
createSingleTimerAsync
<I,O> CompletionStage<akka.Done> createSingleTimerAsync(String name, Duration delay, DeferredCall<I, O> deferredCall) Schedule a single timer. Timers allow for scheduling calls in the future. For example, to verify that some process have been completed or not.Timers are persisted and are guaranteed to run at least once.
When a timer is triggered, the scheduled call is executed. If successfully executed, the timer completes and is automatically removed. In case of a failure, the timer is rescheduled with an exponentially increasing delay, starting at 3 seconds with a max delay of 30 seconds. This process repeats until the call succeeds.
Each timer has a
name
and if a new timer with samename
is registered the previous is cancelled.- Parameters:
name
- unique name for the timerdelay
- delay, starting from now, in which the timer should be triggereddeferredCall
- a call to component that will be executed when the timer is triggered- Returns:
- A completion stage that is completed successfully or failed, once the timer has been scheduled
-
createSingleTimerAsync
<I,O> CompletionStage<akka.Done> createSingleTimerAsync(String name, Duration delay, int maxRetries, DeferredCall<I, O> deferredCall) Schedule a single timer. Timers allow for scheduling calls in the future. For example, to verify that some process have been completed or not.Timers are persisted and are guaranteed to run at least once.
When a timer is triggered, the scheduled call is executed. If successfully executed, the timer completes and is automatically removed. In case of a failure, the timer is rescheduled with a delay of 3 seconds. This process repeats until the call succeeds or the maxRetries limit is reached.
Each timer has a
name
and if a new timer with samename
is registered the previous is cancelled.- Parameters:
name
- unique name for the timerdelay
- delay, starting from now, in which the timer should be triggeredmaxRetries
- Retry up to this many times before giving updeferredCall
- a call to component that will be executed when the timer is triggered- Returns:
- A completion stage that is completed successfully or failed, once the timer has been scheduled
-
deleteAsync
Delete an existing timer. This completes successfully if no timer is registered for the passed name. -
startSingleTimer
@Deprecated(since="3.3.0", forRemoval=true) <I,O> CompletionStage<akka.Done> startSingleTimer(String name, Duration delay, DeferredCall<I, O> deferredCall) Deprecated, for removal: This API element is subject to removal in a future version. -
startSingleTimer
@Deprecated(since="3.3.0", forRemoval=true) <I,O> CompletionStage<akka.Done> startSingleTimer(String name, Duration delay, int maxRetries, DeferredCall<I, O> deferredCall) Deprecated, for removal: This API element is subject to removal in a future version. -
cancel
Deprecated, for removal: This API element is subject to removal in a future version.UserdeleteAsync(String)
instead.
-
deleteAsync(String)
instead.