FakeJob
class FakeJob extends 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 |
int | $releaseDelay | The number of seconds the released job was delayed. |
|
int | $attempts | The number of attempts made to process the job. |
|
Throwable | $failedWith | The exception the job failed with. |
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 of the job.
Delete the job from the queue.
Release the job back into the queue after (n) seconds.
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 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.
void
fail(Throwable|null $exception = 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.