SqsJob
extends Job
in package
implements
Job
Interfaces, Classes and Traits
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 : array<string|int, mixed>
- The Amazon SQS job instance.
- $queue : string
- The name of the queue the job belongs to.
- $released : bool
- Indicates if the job has been released.
- $sqs : SqsClient
- The Amazon SQS client instance.
- __construct() : void
- Create a new job instance.
- attempts() : int
- Get the number of times the job has been attempted.
- 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() : string
- Get the job identifier.
- getName() : string
- Get the name of the queued job class.
- getQueue() : string
- Get the name of the queue the job belongs to.
- getRawBody() : string
- Get the raw body string for the job.
- getSqs() : SqsClient
- Get the underlying SQS client instance.
- getSqsJob() : array<string|int, mixed>
- Get the underlying raw SQS 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
$job
The Amazon SQS job instance.
protected
array<string|int, mixed>
$job
$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
$sqs
The Amazon SQS client instance.
protected
SqsClient
$sqs
Methods
__construct()
Create a new job instance.
public
__construct(Container $container, SqsClient $sqs, array<string|int, mixed> $job, string $connectionName, string $queue) : void
Parameters
- $container : Container
- $sqs : SqsClient
- $job : array<string|int, mixed>
- $connectionName : string
- $queue : string
Return values
void —attempts()
Get the number of times the job has been attempted.
public
attempts() : int
Return values
int —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() : string
Return values
string —getName()
Get the name of the queued job class.
public
getName() : string
Return values
string —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 —getSqs()
Get the underlying SQS client instance.
public
getSqs() : SqsClient
Return values
SqsClient —getSqsJob()
Get the underlying raw SQS job.
public
getSqsJob() : array<string|int, mixed>
Return values
array<string|int, mixed> —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