Interface WorkerPool

All Superinterfaces:
AutoCloseable, Executor, ExecutorService
All Known Implementing Classes:
ControllableWorkStealingPool, ForkJoinPoolWrapper

public interface WorkerPool extends ExecutorService
Interface for worker pools that execute CPU-bound jobs for actors. This interface abstracts two implementation strategies: 1. ForkJoinPool-based (work-stealing, default) 2. ControllableWorkStealingPool (ThreadPoolExecutor-based with job cancellation) Implementations must provide ExecutorService compatibility for use with ActorRef.tell(action, pool) and ActorRef.ask(action, pool).
Since:
1.0.0
Author:
devteam@scivics-lab.com
  • Method Details

    • cancelJobsForActor

      default int cancelJobsForActor(String actorName)
      Cancels all pending jobs for a specific actor. Jobs that are already running will continue to completion.
      Parameters:
      actorName - the name of the actor whose jobs should be cancelled
      Returns:
      the number of jobs that were cancelled
    • getPendingJobCountForActor

      default int getPendingJobCountForActor(String actorName)
      Gets the number of pending jobs for a specific actor.
      Parameters:
      actorName - the name of the actor
      Returns:
      the number of pending jobs
    • supportsCancellation

      default boolean supportsCancellation()
      Checks if this worker pool supports job cancellation per actor.
      Returns:
      true if cancelJobsForActor() is supported