SyncJob
class SyncJob extends Job implements Job (View source)
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 string | $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 string | $job | The class name of the job. |
|
protected string | $payload | The queue message data. |
Methods
Get the number of seconds until the given DateTime.
If the given value is an interval, convert it to a DateTime instance.
Get the job identifier.
Get the raw body string for the job.
Release the job back into the queue after (n) seconds.
Delete the job, call the "failed" method, and raise the failed job event.
The number of seconds to wait before retrying a job that encountered an uncaught exception.
Get the name of the queue the job belongs to.
Create a new job instance.
Get the number of times the job has been attempted.
Details
protected int
secondsUntil(DateTimeInterface|DateInterval|int $delay)
Get the number of seconds until the given DateTime.
protected int
availableAt(DateTimeInterface|DateInterval|int $delay = 0)
Get the "available at" UNIX timestamp.
protected DateTimeInterface|int
parseDateInterval(DateTimeInterface|DateInterval|int $delay)
If the given value is an interval, convert it to a DateTime instance.
protected int
currentTime()
Get the current system time as a UNIX timestamp.
string
getJobId()
Get the job identifier.
string
getRawBody()
Get the raw body string for the job.
in
Job at line 86
string|null
uuid()
Get the UUID of the job.
in
Job at line 96
void
fire()
Fire the job.
in
Job at line 110
void
delete()
Delete the job from the queue.
in
Job at line 120
bool
isDeleted()
Determine if the job has been deleted.
void
release(int $delay = 0)
Release the job back into the queue after (n) seconds.
in
Job at line 141
bool
isReleased()
Determine if the job was released back into the queue.
in
Job at line 151
bool
isDeletedOrReleased()
Determine if the job has been deleted or released.
in
Job at line 161
bool
hasFailed()
Determine if the job has been marked as a failure.
in
Job at line 171
void
markAsFailed()
Mark the job as "failed".
in
Job at line 182
void
fail(Throwable|null $e = null)
Delete the job, call the "failed" method, and raise the failed job event.
in
Job at line 229
protected void
failed(Throwable|null $e)
Process an exception that caused the job to fail.
in
Job at line 246
protected mixed
resolve(string $class)
Resolve the given class.
in
Job at line 256
mixed
getResolvedJob()
Get the resolved job handler instance.
in
Job at line 266
array
payload()
Get the decoded body of the job.
in
Job at line 276
int|null
maxTries()
Get the number of times to attempt a job.
in
Job at line 286
int|null
maxExceptions()
Get the number of times to attempt a job after an exception.
in
Job at line 296
bool
shouldFailOnTimeout()
Determine if the job should fail when it timeouts.
in
Job at line 306
int|int[]|null
backoff()
The number of seconds to wait before retrying a job that encountered an uncaught exception.
in
Job at line 316
int|null
timeout()
Get the number of seconds the job can run.
in
Job at line 326
int|null
retryUntil()
Get the timestamp indicating when the job should timeout.
in
Job at line 336
string
getName()
Get the name of the queued job class.
in
Job at line 348
string
resolveName()
Get the resolved name of the queued job class.
Resolves the name of "wrapped" jobs such as class-based handlers.
in
Job at line 358
string
getConnectionName()
Get the name of the connection the job belongs to.
string
getQueue()
Get the name of the queue the job belongs to.
in
Job at line 378
Container
getContainer()
Get the service container instance.
void
__construct(Container $container, string $payload, string $connectionName, string $queue)
Create a new job instance.
int
attempts()
Get the number of times the job has been attempted.