Skip to content

ProcessQueueInterface

github-actions edited this page Apr 17, 2026 · 1 revision

Defines a queue responsible for collecting and executing process instances.

Implementations MUST preserve the execution contract defined by this interface and SHALL provide deterministic behavior for adding queued processes and running them.

Queued processes MAY be configured to run detached from the main blocking flow and MAY also be configured to not affect the final execution result. These behaviors are independent and MUST be interpreted according to the method contract declared below.


  • Full name: \FastForward\DevTools\Process\ProcessQueueInterface

Constants

Constant Visibility Type Value
SUCCESS public int 0
FAILURE public int 1

Methods

add

Adds a process to the queue.

public add(\Symfony\Component\Process\Process $process, bool $ignoreFailure = false, bool $detached = false): void

The provided process MUST be accepted for later execution by the queue.

When $ignoreFailure is set to true, a failure of the process MUST NOT affect the final status code returned by run(). Implementations SHOULD still report or record such a failure when that information is useful for diagnostics.

When $detached is set to true, the process SHALL be started without blocking the execution of subsequent queue entries. A detached process MAY continue running after the queue advances to the next entry.

Implementations MUST NOT mutate the semantic intent of the supplied process in a way that would make its execution meaningfully different from what the caller configured before enqueueing it.

Parameters:

Parameter Type Description
$process \Symfony\Component\Process\Process the process instance that SHALL be added to the queue
$ignoreFailure bool indicates whether a failure of this process MUST NOT affect the final queue result
$detached bool indicates whether this process SHALL be started without blocking the next queued process

run

Runs the queued processes and returns the resulting status code.

public run(?\Symfony\Component\Console\Output\OutputInterface $output = null): int

Implementations MUST return an integer exit status representing the overall execution result of the queue.

Failures from processes added with $ignoreFailure set to true MUST NOT be reflected in the final returned status code.

The returned status code SHOULD represent the aggregated outcome of all queued processes whose failures are not configured to be ignored.

Parameters:

Parameter Type Description
$output ?\Symfony\Component\Console\Output\OutputInterface the output interface to which process output and diagnostics MAY be written

Return Value:

the final exit status code produced by the queue execution


wait

Waits for all detached processes to finish execution.

public wait(?\Symfony\Component\Console\Output\OutputInterface $output = null): void

Implementations MUST block the execution thread until all previously started detached processes complete. This ensures the main process does not exit prematurely, preventing detached children from being abruptly terminated.

Parameters:

Parameter Type Description
$output ?\Symfony\Component\Console\Output\OutputInterface the output interface to which process output and diagnostics MAY be written

Clone this wiki locally