Documentation

BeanstalkdJob extends Job
in package
implements Job

Interfaces, Classes and Traits

Job

Table of Contents

$connectionName  : mixed
The name of the connection the job belongs to.
$container  : Container
The IoC container instance.
$deleted  : bool
Indicates if the job has been deleted.
$failed  : bool
Indicates if the job has failed.
$instance  : mixed
The job handler instance.
$job  : Job
The Pheanstalk job instance.
$pheanstalk  : Pheanstalk
The Pheanstalk instance.
$queue  : string
The name of the queue the job belongs to.
$released  : bool
Indicates if the job has been released.
__construct()  : void
Create a new job instance.
attempts()  : int
Get the number of times the job has been attempted.
bury()  : void
Bury the job in the queue.
delete()  : void
Delete the job from the queue.
failed()  : void
Process an exception that caused the job to fail.
fire()  : void
Fire the job.
getConnectionName()  : string
Get the name of the connection the job belongs to.
getContainer()  : Container
Get the service container instance.
getJobId()  : int
Get the job identifier.
getName()  : string
Get the name of the queued job class.
getPheanstalk()  : Pheanstalk
Get the underlying Pheanstalk instance.
getPheanstalkJob()  : Job
Get the underlying Pheanstalk job.
getQueue()  : string
Get the name of the queue the job belongs to.
getRawBody()  : string
Get the raw body string for the job.
hasFailed()  : bool
Determine if the job has been marked as a failure.
isDeleted()  : bool
Determine if the job has been deleted.
isDeletedOrReleased()  : bool
Determine if the job has been deleted or released.
isReleased()  : bool
Determine if the job was released back into the queue.
markAsFailed()  : void
Mark the job as "failed".
maxTries()  : int|null
Get the number of times to attempt a job.
payload()  : array<string|int, mixed>
Get the decoded body of the job.
release()  : void
Release the job back into the queue.
resolveName()  : string
Get the resolved name of the queued job class.
timeout()  : int|null
Get the number of seconds the job can run.
timeoutAt()  : int|null
Get the timestamp indicating when the job should timeout.
availableAt()  : int
Get the "available at" UNIX timestamp.
currentTime()  : int
Get the current system time as a UNIX timestamp.
parseDateInterval()  : DateTimeInterface|int
If the given value is an interval, convert it to a DateTime instance.
resolve()  : mixed
Resolve the given class.
secondsUntil()  : int
Get the number of seconds until the given DateTime.

Properties

$connectionName

The name of the connection the job belongs to.

protected mixed $connectionName

$container

The IoC container instance.

protected Container $container

$deleted

Indicates if the job has been deleted.

protected bool $deleted = false

$failed

Indicates if the job has failed.

protected bool $failed = false

$instance

The job handler instance.

protected mixed $instance

$queue

The name of the queue the job belongs to.

protected string $queue

$released

Indicates if the job has been released.

protected bool $released = false

Methods

__construct()

Create a new job instance.

public __construct(Container $container, Pheanstalk $pheanstalk, Job $job, string $connectionName, string $queue) : void
Parameters
$container : Container
$pheanstalk : Pheanstalk
$job : Job
$connectionName : string
$queue : string
Return values
void

attempts()

Get the number of times the job has been attempted.

public attempts() : int
Return values
int

bury()

Bury the job in the queue.

public bury() : void
Return values
void

delete()

Delete the job from the queue.

public delete() : void
Return values
void

failed()

Process an exception that caused the job to fail.

public failed(Exception $e) : void
Parameters
$e : Exception
Return values
void

fire()

Fire the job.

public fire() : void
Return values
void

getConnectionName()

Get the name of the connection the job belongs to.

public getConnectionName() : string
Return values
string

getContainer()

Get the service container instance.

public getContainer() : Container
Return values
Container

getJobId()

Get the job identifier.

public getJobId() : int
Return values
int

getName()

Get the name of the queued job class.

public getName() : string
Return values
string

getPheanstalkJob()

Get the underlying Pheanstalk job.

public getPheanstalkJob() : Job
Return values
Job

getQueue()

Get the name of the queue the job belongs to.

public getQueue() : string
Return values
string

getRawBody()

Get the raw body string for the job.

public getRawBody() : string
Return values
string

hasFailed()

Determine if the job has been marked as a failure.

public hasFailed() : bool
Return values
bool

isDeleted()

Determine if the job has been deleted.

public isDeleted() : bool
Return values
bool

isDeletedOrReleased()

Determine if the job has been deleted or released.

public isDeletedOrReleased() : bool
Return values
bool

isReleased()

Determine if the job was released back into the queue.

public isReleased() : bool
Return values
bool

markAsFailed()

Mark the job as "failed".

public markAsFailed() : void
Return values
void

maxTries()

Get the number of times to attempt a job.

public maxTries() : int|null
Return values
int|null

payload()

Get the decoded body of the job.

public payload() : array<string|int, mixed>
Return values
array<string|int, mixed>

release()

Release the job back into the queue.

public release(int $delay) : void
Parameters
$delay : int
Return values
void

resolveName()

Get the resolved name of the queued job class.

public resolveName() : string

Resolves the name of "wrapped" jobs such as class-based handlers.

Return values
string

timeout()

Get the number of seconds the job can run.

public timeout() : int|null
Return values
int|null

timeoutAt()

Get the timestamp indicating when the job should timeout.

public timeoutAt() : int|null
Return values
int|null

availableAt()

Get the "available at" UNIX timestamp.

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

currentTime()

Get the current system time as a UNIX timestamp.

protected currentTime() : int
Return values
int

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

resolve()

Resolve the given class.

protected resolve(string $class) : mixed
Parameters
$class : string
Return values
mixed

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