The Executor
used to schedule reactor tasks.
Tells the scheduler to start listening to schedule requests for the reactor frame.
Tells the scheduler to start listening to schedule requests for the reactor frame. Clients never call this method directly.
By default, assigns the default scheduler state to the schedulerState
field in
the reactor frame.
the reactor frame to start scheduling
Creates an State
object for the reactor frame.
Called immediately after a reactor frame completes an execution batch.
Called immediately before a reactor frame begins an execution batch.
Notifies a reactor frame that it should be executed.
A
Scheduler
that reuses the target JavaExecutor
.It checks if the specified executor is a
ForkJoinPool
that usesReactorForkJoinWorkerThread
and, if so, applies additional optimizations:schedule
is called from aForkJoinWorkerThread
that belongs to theForkJoinPool
that is theexecutor
, then a more lightweight mechanism is used to schedule the task.postschedule
. This will attempt to remove submitted tasks from theForkJoinPool
a certain of times and execute them directly. Thescheduler.default.postschedule-count
bundle configuration key is the maximum number of attempts. If removing is not successful, this immediately stops.ReactorForkJoinWorkerThread
has an associated mini-queue into which it stores at most one scheduledFrame
. Any frame must first be in the mini-queue before getting converted into a task and sent to the queue. Before any such worker thread returns control to the pool, it must flush its mini-queue. Simultaneously, there is a reanimator thread that periodically traverses the mini-queues of all the threads, and flushes them if necessary.