Class WorkStealingGroup

java.lang.Object
io.camunda.zeebe.scheduler.WorkStealingGroup
All Implemented Interfaces:
TaskScheduler

public final class WorkStealingGroup extends Object implements TaskScheduler
Workstealing group maintains a queue per thread.
  • Constructor Details

    • WorkStealingGroup

      public WorkStealingGroup(int numOfThreads)
  • Method Details

    • submit

      public void submit(ActorTask task, int threadId)
      Submit the task into the provided thread's queue
      Parameters:
      task - the task to submit
      threadId - the id of the thread into which queue the task should be submitted
    • getNextTask

      public ActorTask getNextTask()
      Attempts to acquire the next task to execute
      Specified by:
      getNextTask in interface TaskScheduler
      Returns:
      the acquired task or null if no task is available