class QueueCommands extends DrushCommands (View source)

Traits

ProcessManagerAwareTrait
LoggerAwareTrait
IO
ConfigAwareTrait

Constants

REQ

OPT

EXIT_SUCCESS

EXIT_FAILURE

EXIT_FAILURE_WITH_CLARITY

Properties

protected CommandData $commandData from  DrushCommands
protected QueueWorkerManager $workerManager
protected $queueService
static protected array $queues Keep track of queue definitions.

Methods

getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(QueueWorkerManagerInterface $workerManager, QueueFactory $queueService)

No description

io()

Override Robo's IO function with our custom style.

LoggerInterface
logger()

Returns a logger object.

printFile(string $file)

Print the contents of a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

HandlerStack
getStack()

Get a Guzzle handler stack that uses the Drush logger.

QueueWorkerManager
getWorkerManager()

No description

QueueFactory
getQueueService()

No description

run($name, $options = ['time-limit' => self::REQ, 'items-limit' => self::REQ, 'lease-time' => self::REQ])

Run a specific queue by name.

RowsOfFields
qList($options = ['format' => 'table'])

Returns a list of all defined queues.

delete($name)

Delete all items in a specific queue.

CommandError|null
validateQueueName(CommandData $commandData)

Validate that queue permission exists.

getQueues()

{@inheritdoc}

QueueInterface
getQueue($name)

{@inheritdoc}

Details

DrushConfig getConfig()

Replaces same method in ConfigAwareTrait in order to provide a DrushConfig as return type. Helps with IDE completion.

__construct(QueueWorkerManagerInterface $workerManager, QueueFactory $queueService)

Parameters

QueueWorkerManagerInterface $workerManager
QueueFactory $queueService

protected io()

Override Robo's IO function with our custom style.

protected LoggerInterface logger()

Returns a logger object.

Return Value

LoggerInterface

protected printFile(string $file)

Print the contents of a file.

Parameters

string $file Full path to a file.

preHook(CommandData $commandData)

Persist commandData for use in primary command callback. Used by 'topic' commands.

Parameters

CommandData $commandData

protected printFileTopic(CommandData $commandData)

Print the contents of a file. The path comes from the @topic annotation.

Parameters

CommandData $commandData Full path to a file.

protected HandlerStack getStack()

Get a Guzzle handler stack that uses the Drush logger.

QueueWorkerManager getWorkerManager()

Return Value

QueueWorkerManager

QueueFactory getQueueService()

Return Value

QueueFactory

run($name, $options = ['time-limit' => self::REQ, 'items-limit' => self::REQ, 'lease-time' => self::REQ])

Run a specific queue by name.

Parameters

$name
$options

RowsOfFields qList($options = ['format' => 'table'])

Returns a list of all defined queues.

Parameters

$options

Return Value

RowsOfFields

delete($name)

Delete all items in a specific queue.

Parameters

$name name of the queue to run, as defined in either hook_queue_info or hook_cron_queue_info.

CommandError|null validateQueueName(CommandData $commandData)

Validate that queue permission exists.

Annotation value should be the name of the argument/option containing the name.

Parameters

CommandData $commandData

Return Value

CommandError|null

getQueues()

{@inheritdoc}

QueueInterface getQueue($name)

{@inheritdoc}

Parameters

$name

Return Value

QueueInterface