class Queue

Supports commands related to queues.

Constants

private JOBS_PATH

Path to jobs classes.

Methods

static void
deleteJob(array $job, QueueManager $queue)

Deletes a job

static void
isValidJob(string $jobClass)

Test if name of job class is valid.

static int
iterations(int|null $max = 0, bool $once = false)

Determines number of iterations to run worker

static string
jobTemplate(string $jobName)

Template for Jobs class.

static int
makeJob(string $jobName)

Creates a new job class.

static string
queueTemplate(string $fileName)

Template for queue migration.

static int
queueMigration()

Creates new queue migration.

static void
shutdownSignals()

Manages shutdown signals.

static int
worker(int $maxIterations, string $queueName = 'default')

Worker for queue.

Details

at line 27
static private void deleteJob(array $job, QueueManager $queue)

Deletes a job

Parameters

array $job

The job to be deleted.

QueueManager $queue

The QueueManager instance.

Return Value

void

at line 39
static private void isValidJob(string $jobClass)

Test if name of job class is valid.

Parameters

string $jobClass

The name of class to test.

Return Value

void

at line 52
static int iterations(int|null $max = 0, bool $once = false)

Determines number of iterations to run worker

Parameters

int|null $max

$max The number of times to run worker.

bool $once

Runs worker for one iteration if set to true.

Return Value

int

The number of iterations.

at line 67
static private string jobTemplate(string $jobName)

Template for Jobs class.

Parameters

string $jobName

The name of the job.

Return Value

string

The content of the job class.

at line 121
static int makeJob(string $jobName)

Creates a new job class.

Parameters

string $jobName

The name of the job class.

Return Value

int

A value that indicates success, invalid, or failure.

at line 137
static private string queueTemplate(string $fileName)

Template for queue migration.

Parameters

string $fileName

The file and class name.

Return Value

string

The contents for the queue migration.

at line 187
static int queueMigration()

Creates new queue migration.

Return Value

int

A value that indicates success, invalid, or failure.

at line 201
static private void shutdownSignals()

Manages shutdown signals.

Return Value

void

at line 219
static int worker(int $maxIterations, string $queueName = 'default')

Worker for queue.

Parameters

int $maxIterations
string $queueName

The name of the queue to run.

Return Value

int

A value that indicates success, invalid, or failure.