Interface IAsyncHandlerProvider

All Known Implementing Classes:
AbstractAsyncHandlerProvider, ScheduledThreadPoolAsyncHandlerProvider, SharedHandlerProviderCache.SharedAsyncHandlerProviderWrapper, ThreadAsyncHandlerProvider

public interface IAsyncHandlerProvider
Provides IAsyncHandler for repetitive execution of runnables
Since:
8.0
Author:
eitany
  • Method Details

    • start

      IAsyncHandler start(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
      Start executing a runnable in a repetitive manner.
      Parameters:
      callable - the runnable to execute at each iteration
      idleDelayMilis - the delay between each iteration when the runnable returned a IAsyncHandlerProvider.CycleResult.IDLE_CONTINUE
      name - hint name for the async handler if supported
      waitIdleDelayBeforeStart - should the task run for the first time only after idleDelayMillis
      Returns:
      async handler that allows interaction with the repetitive execution of the runnable If this method is executed after the provider is a closed, the result handler will be terminated on execution IAsyncHandler.isTerminated().
    • startMayBlock

      IAsyncHandler startMayBlock(AsyncCallable callable, long idleDelayMilis, String name, boolean waitIdleDelayBeforeStart)
      Start executing a runnable in a repetitive manner, the task may block during its process so the provider must be able to support this. in terms of thread pool limitations
      Parameters:
      callable - the runnable to execute at each iteration
      idleDelayMilis - the delay between each iteration when the runnable returned a IAsyncHandlerProvider.CycleResult.IDLE_CONTINUE
      name - hint name for the async handler if supported
      waitIdleDelayBeforeStart - should the task run for the first time only after idleDelayMillis
      Returns:
      async handler that allows interaction with the repetitive execution of the runnable If this method is executed after the provider is a closed, the result handler will be terminated on execution IAsyncHandler.isTerminated().
    • close

      void close()
      Close the async handler provider
    • isClosed

      boolean isClosed()
      Specifies is this async handler provider is already closed
    • addStateListener

      boolean addStateListener(IAsyncHandlerProviderStateListener listener)
      Adds a state listener to be notified on this provider state changes events
      Returns:
      false if this provider is already closed
    • removeStateListener

      void removeStateListener(IAsyncHandlerProviderStateListener listener)
      Removes the specified state listener