class BeanstalkdJob extends Job implements Job

Traits

Properties

protected mixed $instance

The job handler instance.

from  Job
protected Container $container

The IoC container instance.

from  Job
protected bool $deleted

Indicates if the job has been deleted.

from  Job
protected bool $released

Indicates if the job has been released.

from  Job
protected bool $failed

Indicates if the job has failed.

from  Job
protected $connectionName

The name of the connection the job belongs to.

from  Job
protected string $queue

The name of the queue the job belongs to.

from  Job
protected Pheanstalk $pheanstalk

The Pheanstalk instance.

protected Job $job

The Pheanstalk job instance.

Methods

int
secondsUntil(DateTimeInterface $delay)

Get the number of seconds until the given DateTime.

int
availableAt(DateTimeInterface|int $delay = 0)

Get the "available at" UNIX timestamp.

int
currentTime()

Get the current system time as a UNIX timestamp.

void
fire()

Fire the job.

from  Job
void
delete()

Delete the job from the queue.

bool
isDeleted()

Determine if the job has been deleted.

from  Job
void
release(int $delay = 0)

Release the job back into the queue.

bool
isReleased()

Determine if the job was released back into the queue.

from  Job
bool
isDeletedOrReleased()

Determine if the job has been deleted or released.

from  Job
bool
hasFailed()

Determine if the job has been marked as a failure.

from  Job
void
markAsFailed()

Mark the job as "failed".

from  Job
void
failed(Exception $e)

Process an exception that caused the job to fail.

from  Job
mixed
resolve(string $class)

Resolve the given class.

from  Job
array
payload()

Get the decoded body of the job.

from  Job
int|null
maxTries()

The number of times to attempt a job.

from  Job
int|null
timeout()

The number of seconds the job can run.

from  Job
string
getName()

Get the name of the queued job class.

from  Job
string
resolveName()

Get the resolved name of the queued job class.

from  Job
string
getConnectionName()

Get the name of the connection the job belongs to.

from  Job
string
getQueue()

Get the name of the queue the job belongs to.

from  Job
getContainer()

Get the service container instance.

from  Job
void
__construct(Container $container, Pheanstalk $pheanstalk, Job $job, string $connectionName, string $queue)

Create a new job instance.

void
bury()

Bury the job in the queue.

int
attempts()

Get the number of times the job has been attempted.

string
getJobId()

Get the job identifier.

string
getRawBody()

Get the raw body string for the job.

Pheanstalk
getPheanstalk()

Get the underlying Pheanstalk instance.

Job
getPheanstalkJob()

Get the underlying Pheanstalk job.

Details

in InteractsWithTime at line 16
protected int secondsUntil(DateTimeInterface $delay)

Get the number of seconds until the given DateTime.

Parameters

DateTimeInterface $delay

Return Value

int

in InteractsWithTime at line 29
protected int availableAt(DateTimeInterface|int $delay = 0)

Get the "available at" UNIX timestamp.

Parameters

DateTimeInterface|int $delay

Return Value

int

in InteractsWithTime at line 41
protected int currentTime()

Get the current system time as a UNIX timestamp.

Return Value

int

in Job at line 63
void fire()

Fire the job.

Return Value

void

at line 77
void delete()

Delete the job from the queue.

Return Value

void

in Job at line 87
bool isDeleted()

Determine if the job has been deleted.

Return Value

bool

at line 51
void release(int $delay = 0)

Release the job back into the queue.

Parameters

int $delay

Return Value

void

in Job at line 108
bool isReleased()

Determine if the job was released back into the queue.

Return Value

bool

in Job at line 118
bool isDeletedOrReleased()

Determine if the job has been deleted or released.

Return Value

bool

in Job at line 128
bool hasFailed()

Determine if the job has been marked as a failure.

Return Value

bool

in Job at line 138
void markAsFailed()

Mark the job as "failed".

Return Value

void

in Job at line 149
void failed(Exception $e)

Process an exception that caused the job to fail.

Parameters

Exception $e

Return Value

void

in Job at line 168
protected mixed resolve(string $class)

Resolve the given class.

Parameters

string $class

Return Value

mixed

in Job at line 178
array payload()

Get the decoded body of the job.

Return Value

array

in Job at line 188
int|null maxTries()

The number of times to attempt a job.

Return Value

int|null

in Job at line 198
int|null timeout()

The number of seconds the job can run.

Return Value

int|null

in Job at line 208
string getName()

Get the name of the queued job class.

Return Value

string

in Job at line 220
string resolveName()

Get the resolved name of the queued job class.

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

Return Value

string

in Job at line 230
string getConnectionName()

Get the name of the connection the job belongs to.

Return Value

string

in Job at line 240
string getQueue()

Get the name of the queue the job belongs to.

Return Value

string

in Job at line 250
Container getContainer()

Get the service container instance.

Return Value

Container

at line 36
void __construct(Container $container, Pheanstalk $pheanstalk, Job $job, string $connectionName, string $queue)

Create a new job instance.

Parameters

Container $container
Pheanstalk $pheanstalk
Job $job
string $connectionName
string $queue

Return Value

void

at line 65
void bury()

Bury the job in the queue.

Return Value

void

at line 89
int attempts()

Get the number of times the job has been attempted.

Return Value

int

at line 101
string getJobId()

Get the job identifier.

Return Value

string

at line 111
string getRawBody()

Get the raw body string for the job.

Return Value

string

at line 121
Pheanstalk getPheanstalk()

Get the underlying Pheanstalk instance.

Return Value

Pheanstalk

at line 131
Job getPheanstalkJob()

Get the underlying Pheanstalk job.

Return Value

Job