Interface TimerScheduler


public interface TimerScheduler
  • Method Details Link icon

    • createSingleTimer Link icon

      <I, O> void createSingleTimer(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 same name is registered the previous is cancelled.

      Parameters:
      name - unique name for the timer
      delay - delay, starting from now, in which the timer should be triggered
      deferredCall - a call to component that will be executed when the timer is triggered
    • createSingleTimer Link icon

      <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 same name is registered the previous is cancelled.

      Parameters:
      name - unique name for the timer
      delay - delay, starting from now, in which the timer should be triggered
      maxRetries - Retry up to this many times before giving up
      deferredCall - a call to component that will be executed when the timer is triggered
    • delete Link icon

      void delete(String name)
      Delete an existing timer. This completes successfully if no timer is registered for the passed name.
    • createSingleTimerAsync Link icon

      <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 same name is registered the previous is cancelled.

      Parameters:
      name - unique name for the timer
      delay - delay, starting from now, in which the timer should be triggered
      deferredCall - 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 Link icon

      <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 same name is registered the previous is cancelled.

      Parameters:
      name - unique name for the timer
      delay - delay, starting from now, in which the timer should be triggered
      maxRetries - Retry up to this many times before giving up
      deferredCall - 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 Link icon

      CompletionStage<akka.Done> deleteAsync(String name)
      Delete an existing timer. This completes successfully if no timer is registered for the passed name.
    • startSingleTimer Link icon

      @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 Link icon

      @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 Link icon

      @Deprecated(since="3.3.0", forRemoval=true) CompletionStage<akka.Done> cancel(String name)
      Deprecated, for removal: This API element is subject to removal in a future version.
      User deleteAsync(String) instead.