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.
Given a start time, format the total run time for human readability.
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.
Determine if the current database transaction should be rolled back to level zero.
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 string
runTimeForHumans(float $startTime, float $endTime = null)
Given a start time, format the total run time for human readability.
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 233
protected bool
shouldRollBackDatabaseTransaction(Throwable $e)
Determine if the current database transaction should be rolled back to level zero.
in
Job at line 247
protected void
failed(Throwable|null $e)
Process an exception that caused the job to fail.
in
Job at line 304
int|null
maxExceptions()
Get the number of times to attempt a job after an exception.
in
Job at line 324
int|int[]|null
backoff()
The number of seconds to wait before retrying a job that encountered an uncaught exception.
in
Job at line 366
string
resolveName()
Get the resolved display name of the queued job class.
Resolves the name of "wrapped" jobs such as class-based handlers.
in
Job at line 378
string
resolveQueuedJobClass()
Get the class of the queued job.
Resolves the class of "wrapped" jobs such as class-based handlers.
__construct(Container $container, string $payload, string $connectionName, string $queue)
Create a new job instance.