Interface ConcurrencyControl

All Known Implementing Classes:
Actor, ActorControl

public interface ConcurrencyControl
Control interface to schedule tasks or follow-up tasks such that different tasks scheduled via the same ConcurrencyControl object are never executed concurrently
  • Method Details

    • runOnCompletion

      <T> void runOnCompletion(ActorFuture<T> future, BiConsumer<T,Throwable> callback)
      Schedules a callback to be invoked after the future has completed
      Type Parameters:
      T - result type of the future
      Parameters:
      future - the future whose completion is awaited
      callback - the callback to call after the future has completed
    • run

      void run(Runnable action)
      Schedules an action to be invoked (must be called from an actor thread)
      Parameters:
      action - action to be invoked
    • createFuture

      default <V> ActorFuture<V> createFuture()
      Create a new future object
      Type Parameters:
      V - value type of future
      Returns:
      new future object
    • createCompletedFuture

      default <V> ActorFuture<V> createCompletedFuture()
      Create a new completed future object
      Type Parameters:
      V - value type of future
      Returns:
      new completed future object