\Omega\Queue\Command WorkCommand

Work command class.

The Work class represents a unit of work to be executed within a queue system. It encapsulates a specific task or job that can be processed asynchronously. Instances of this class define the work to be performed and can be enqueued in a queue manager for deferred execution.

Summary

Methods
Properties
Constants
__construct
No public properties found
No public constants found
configure
execute
defaultName
No protected constants found
No private methods found
No private properties found
No private constants found

Properties

$defaultName

$defaultName : string

Default command name.

Type

string — Holds the default command name.

Methods

__construct()

__construct() : void

Command constructor.

Returns

void —

configure()

configure() : void

Configures the current command.

This method configures the command description, options, and help information.

Returns

void —

execute()

execute(\Symfony\Component\Console\Input\InputInterface  $input, \Symfony\Component\Console\Output\OutputInterface  $output) : int

Executes the current command.

This method executes the queue work, processing and completing jobs that have been enqueued. It provides feedback on job completion and handles exceptions gracefully, updating job status accordingly.

Parameters

\Symfony\Component\Console\Input\InputInterface $input

Holds an instance of InputInterface.

\Symfony\Component\Console\Output\OutputInterface $output

Holds an instance of OutputInterface.

Returns

int —

Return 0 if everything went fine, or an exit code.