Package io.camunda.zeebe.scheduler
Class ActorThread
java.lang.Object
java.lang.Thread
io.camunda.zeebe.scheduler.ActorThread
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classstatic enumNested classes/interfaces inherited from class java.lang.Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandler -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ActorThread.ActorTaskRunnerIdleStrategyfinal org.agrona.concurrent.ManyToManyConcurrentArrayQueue<Runnable> protected final ActorTimerQueueFields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY -
Constructor Summary
ConstructorsConstructorDescriptionActorThread(String name, int id, ActorThreadGroup threadGroup, TaskScheduler taskScheduler, ActorClock clock, ActorTimerQueue timerQueue, boolean metricsEnabled) ActorThread(String name, int id, ActorThreadGroup threadGroup, TaskScheduler taskScheduler, ActorClock clock, ActorTimerQueue timerQueue, boolean metricsEnabled, org.agrona.concurrent.IdleStrategy idleStrategy) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()static ActorThreadcurrent()Returns the currentActorThreador null if the current thread is not anActorThread.static ActorThreadensureCalledFromActorThread(String methodName) getClock()intvoidstatic booleannewJob()voidremoveTimer(TimerSubscription timer) Must be called from this thread, remove a scheduled job.voidrun()voidscheduleTimer(TimerSubscription timer) Must be called from this thread, schedules a job to be run later.voidstart()Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, startVirtualThread, stop, suspend, threadId, toString, yield
-
Field Details
-
submittedCallbacks
-
timerJobQueue
-
idleStrategy
-
-
Constructor Details
-
ActorThread
public ActorThread(String name, int id, ActorThreadGroup threadGroup, TaskScheduler taskScheduler, ActorClock clock, ActorTimerQueue timerQueue, boolean metricsEnabled) -
ActorThread
public ActorThread(String name, int id, ActorThreadGroup threadGroup, TaskScheduler taskScheduler, ActorClock clock, ActorTimerQueue timerQueue, boolean metricsEnabled, org.agrona.concurrent.IdleStrategy idleStrategy)
-
-
Method Details
-
hintWorkAvailable
public void hintWorkAvailable() -
scheduleTimer
Must be called from this thread, schedules a job to be run later. -
removeTimer
Must be called from this thread, remove a scheduled job. -
current
Returns the currentActorThreador null if the current thread is not anActorThread.- Returns:
- the current
ActorThreador null
-
ensureCalledFromActorThread
-
isCalledFromActorThread
public static boolean isCalledFromActorThread() -
newJob
-
getRunnerId
public int getRunnerId() -
start
public void start() -
run
public void run() -
close
-
getCurrentJob
-
getCurrentTask
-
getClock
-
getActorThreadGroup
-
accept
-