Constructs a new AsyncCommandHandler.
Private
commandQueue of pending AsyncCommand instances.
Private
frameFrame counter for queue processing.
Handler identifier.
Private
pausedMap of paused commands by their unique ID.
Private
queueFrequency (in frames) to process the command queue.
Private
runningMap of running commands by their unique ID.
Number of tasks in the pool.
Private
taskIndex for round-robin task assignment.
Private
tasksPool of ISGNTask worker tasks.
Called periodically by the timer service to process the command queue.
The time delta since the last tick.
Cancels a command by removing it from the queue or sending a cancel command to its task.
The AsyncCommand to cancel.
Private
cancelRemoves a pending command from the queue if present.
The AsyncCommand to remove.
True if the command was removed, false otherwise.
Creates the specified number of ISGNTask workers.
Number of tasks to create.
Private
dispatchDispatches a command to the next available task.
The AsyncCommand to dispatch.
Private
getPrivate
getPrepares the task command object and assigns the command to a task.
The AsyncCommand to assign.
The ISGNTask to assign to.
The task command object.
Handles a new AsyncCommand by adding it to the queue and marking it as pending.
The AsyncCommand to handle.
Private
onObserver callback for task events. Handles command completion, failure, or cancellation.
The task event containing the async event data.
Pauses a running command, moving it to the paused map.
The AsyncCommand to pause.
Private
processProcesses the command queue, dispatching all pending commands to tasks.
Resumes a paused command, returning it to the queue.
The AsyncCommand to resume.
Starts the handler and creates the specified number of tasks.
Number of tasks to initialize.
AsyncCommandHandler manages the lifecycle, execution, and state of asynchronous commands.
Remarks