Documentation

BeanstalkdQueue extends Queue
in package
implements Queue

Interfaces, Classes and Traits

Queue

Table of Contents

$connectionName  : string
The connection name for the queue.
$container  : Container
The IoC container instance.
$default  : string
The name of the default tube.
$encrypter  : Encrypter
The encrypter implementation.
$pheanstalk  : Pheanstalk
The Pheanstalk instance.
$timeToRun  : int
The "time to run" for all pushed jobs.
__construct()  : void
Create a new Beanstalkd queue instance.
bulk()  : mixed
Push an array of jobs onto the queue.
deleteMessage()  : void
Delete a message from the Beanstalk queue.
getConnectionName()  : string
Get the connection name for the queue.
getJobExpiration()  : mixed
Get the expiration timestamp for an object-based queue handler.
getPheanstalk()  : Pheanstalk
Get the underlying Pheanstalk instance.
getQueue()  : string
Get the queue or return the default.
later()  : mixed
Push a new job onto the queue after a delay.
laterOn()  : mixed
Push a new job onto the queue after a delay.
pop()  : Job|null
Pop the next job off of the queue.
push()  : mixed
Push a new job onto the queue.
pushOn()  : mixed
Push a new job onto the queue.
pushRaw()  : mixed
Push a raw payload onto the queue.
setConnectionName()  : $this
Set the connection name for the queue.
setContainer()  : void
Set the IoC container instance.
size()  : int
Get the size of the queue.
availableAt()  : int
Get the "available at" UNIX timestamp.
createObjectPayload()  : array<string|int, mixed>
Create a payload for an object-based queue handler.
createPayload()  : string
Create a payload string from the given job and data.
createPayloadArray()  : array<string|int, mixed>
Create a payload array from the given job and data.
createStringPayload()  : array<string|int, mixed>
Create a typical, string based queue payload array.
currentTime()  : int
Get the current system time as a UNIX timestamp.
getDisplayName()  : string
Get the display name for the given job.
parseDateInterval()  : DateTimeInterface|int
If the given value is an interval, convert it to a DateTime instance.
secondsUntil()  : int
Get the number of seconds until the given DateTime.

Properties

$connectionName

The connection name for the queue.

protected string $connectionName

$timeToRun

The "time to run" for all pushed jobs.

protected int $timeToRun

Methods

__construct()

Create a new Beanstalkd queue instance.

public __construct(Pheanstalk $pheanstalk, string $default, int $timeToRun) : void
Parameters
$pheanstalk : Pheanstalk
$default : string
$timeToRun : int
Return values
void

bulk()

Push an array of jobs onto the queue.

public bulk(array<string|int, mixed> $jobs[, mixed $data = '' ][, string $queue = null ]) : mixed
Parameters
$jobs : array<string|int, mixed>
$data : mixed = ''
$queue : string = null
Return values
mixed

deleteMessage()

Delete a message from the Beanstalk queue.

public deleteMessage(string $queue, string $id) : void
Parameters
$queue : string
$id : string
Return values
void

getConnectionName()

Get the connection name for the queue.

public getConnectionName() : string
Return values
string

getJobExpiration()

Get the expiration timestamp for an object-based queue handler.

public getJobExpiration(mixed $job) : mixed
Parameters
$job : mixed
Return values
mixed

getQueue()

Get the queue or return the default.

public getQueue(string|null $queue) : string
Parameters
$queue : string|null
Return values
string

later()

Push a new job onto the queue after a delay.

public later(DateTimeInterface|DateInterval|int $delay, string $job[, mixed $data = '' ][, string $queue = null ]) : mixed
Parameters
$delay : DateTimeInterface|DateInterval|int
$job : string
$data : mixed = ''
$queue : string = null
Return values
mixed

laterOn()

Push a new job onto the queue after a delay.

public laterOn(string $queue, DateTimeInterface|DateInterval|int $delay, string $job[, mixed $data = '' ]) : mixed
Parameters
$queue : string
$delay : DateTimeInterface|DateInterval|int
$job : string
$data : mixed = ''
Return values
mixed

pop()

Pop the next job off of the queue.

public pop([string $queue = null ]) : Job|null
Parameters
$queue : string = null
Return values
Job|null

push()

Push a new job onto the queue.

public push(string $job[, mixed $data = '' ][, string $queue = null ]) : mixed
Parameters
$job : string
$data : mixed = ''
$queue : string = null
Return values
mixed

pushOn()

Push a new job onto the queue.

public pushOn(string $queue, string $job[, mixed $data = '' ]) : mixed
Parameters
$queue : string
$job : string
$data : mixed = ''
Return values
mixed

pushRaw()

Push a raw payload onto the queue.

public pushRaw(string $payload[, string $queue = null ][, array<string|int, mixed> $options = [] ]) : mixed
Parameters
$payload : string
$queue : string = null
$options : array<string|int, mixed> = []
Return values
mixed

setConnectionName()

Set the connection name for the queue.

public setConnectionName(string $name) : $this
Parameters
$name : string
Return values
$this

setContainer()

Set the IoC container instance.

public setContainer(Container $container) : void
Parameters
$container : Container
Return values
void

size()

Get the size of the queue.

public size([string $queue = null ]) : int
Parameters
$queue : string = null
Return values
int

availableAt()

Get the "available at" UNIX timestamp.

protected availableAt(DateTimeInterface|DateInterval|int $delay) : int
Parameters
$delay : DateTimeInterface|DateInterval|int
Return values
int

createObjectPayload()

Create a payload for an object-based queue handler.

protected createObjectPayload(mixed $job) : array<string|int, mixed>
Parameters
$job : mixed
Return values
array<string|int, mixed>

createPayload()

Create a payload string from the given job and data.

protected createPayload(string $job[, mixed $data = '' ]) : string
Parameters
$job : string
$data : mixed = ''
Tags
throws
InvalidPayloadException
Return values
string

createPayloadArray()

Create a payload array from the given job and data.

protected createPayloadArray(string $job[, mixed $data = '' ]) : array<string|int, mixed>
Parameters
$job : string
$data : mixed = ''
Return values
array<string|int, mixed>

createStringPayload()

Create a typical, string based queue payload array.

protected createStringPayload(string $job, mixed $data) : array<string|int, mixed>
Parameters
$job : string
$data : mixed
Return values
array<string|int, mixed>

currentTime()

Get the current system time as a UNIX timestamp.

protected currentTime() : int
Return values
int

getDisplayName()

Get the display name for the given job.

protected getDisplayName(mixed $job) : string
Parameters
$job : mixed
Return values
string

parseDateInterval()

If the given value is an interval, convert it to a DateTime instance.

protected parseDateInterval(DateTimeInterface|DateInterval|int $delay) : DateTimeInterface|int
Parameters
$delay : DateTimeInterface|DateInterval|int
Return values
DateTimeInterface|int

secondsUntil()

Get the number of seconds until the given DateTime.

protected secondsUntil(DateTimeInterface|DateInterval|int $delay) : int
Parameters
$delay : DateTimeInterface|DateInterval|int
Return values
int

Search results