interface QueueDriverInterface

Interface QueueDriverInterface

Defines the contract for a queue driver implementation. A queue driver is responsible for pushing, popping, releasing, and deleting jobs from a queue backend (e.g., database, Redis).

Methods

void
delete(mixed $jobId)

Deletes a job from the queue.

array|null
pop(string $queue)

Retrieves and reserves the next available job from the specified queue.

void
push(string $queue, array $payload)

Pushes a new job onto the specified queue.

void
release(string $queue, array $payload, int $delay = 0)

Releases a job back onto the queue after a failure or delay.

Details

at line 19
void delete(mixed $jobId)

Deletes a job from the queue.

Parameters

mixed $jobId

The unique identifier of the job to delete.

Return Value

void

at line 27
array|null pop(string $queue)

Retrieves and reserves the next available job from the specified queue.

Parameters

string $queue

The name of the queue to pop from.

Return Value

array|null

The job payload as an associative array, or null if no job is available.

at line 36
void push(string $queue, array $payload)

Pushes a new job onto the specified queue.

Parameters

string $queue

The name of the queue to push the job to.

array $payload

The job payload, typically containing the class name and data.

Return Value

void

at line 46
void release(string $queue, array $payload, int $delay = 0)

Releases a job back onto the queue after a failure or delay.

Parameters

string $queue

The name of the queue to release the job to.

array $payload

The job payload to requeue.

int $delay

Delay in seconds before the job becomes available again.

Return Value

void