Package io.camunda.zeebe.util.sched
Class PriorityScheduler
java.lang.Object
io.camunda.zeebe.util.sched.PriorityScheduler
- All Implemented Interfaces:
TaskScheduler
Logic and state for the priority scheduling. Each
ActorThread maintains a local instance
if this class.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetNextTask(ActorClock clock) calculates and returns the next task to execute or null if no such task can be determined.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.camunda.zeebe.util.sched.TaskScheduler
onTaskReleased
-
Constructor Details
-
PriorityScheduler
- Parameters:
getTaskFn- function which can be used to get a task by a given priority class.quotas- the quotas by priority class. Must be an array of doubles, assigning a quota to the priority denoted by the index in the array (if quotas[0] = 0.3, then the quota for the priority class '0' is 0.3). A quota must be a number between [0..1], such that the sum of all quotas in the array is exactly 1. The quota multiplied by 100 corresponds to the number of time slices assigned to this priority class in a second.
-
-
Method Details
-
getNextTask
calculates and returns the next task to execute or null if no such task can be determined.- Specified by:
getNextTaskin interfaceTaskScheduler
-