class PendingClosureDispatch extends PendingDispatch

Traits

Properties

protected bool $afterResponse

Indicates if the job should be dispatched immediately after sending the response.

from  PendingDispatch

Methods

mixed
when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

mixed
unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

mixed
getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)

Get a configuration value from an attribute, falling back to a property.

mixed
extractAttributeValue(object $instance)

Extract the value from an attribute instance.

object|null
getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)

Get an instance of the given attribute class from the target class or its parents.

bool
propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)

Determine if a property declared on a child class overrides an inherited attribute.

__construct(mixed $job)

Create a new pending job dispatch.

onConnection(UnitEnum|string|null $connection)

Set the desired connection for the job.

onQueue(UnitEnum|string|null $queue)

Set the desired queue for the job.

onGroup(array|UnitEnum|string|int|null $group)

Set the desired job message group.

withDeduplicator(array|callable|null $deduplicator)

Set the desired job deduplicator callback.

allOnConnection(UnitEnum|string|null $connection)

Set the desired connection for the chain.

allOnQueue(UnitEnum|string|null $queue)

Set the desired queue for the chain.

delay(DateInterval|DateTimeInterface|int|null $delay)

Set the desired delay in seconds for the job.

withoutDelay()

Set the delay for the job to zero seconds.

afterCommit()

Indicate that the job should be dispatched after all database transactions have committed.

beforeCommit()

Indicate that the job should not wait until database transactions have been committed before dispatching.

chain(array $chain)

Set the jobs that should run if this job is successful.

afterResponse(bool $afterResponse = true)

Indicate that the job should be dispatched after the response is sent to the browser.

mixed
getJob()

Get the underlying job instance.

bool
shouldDispatch()

Determine if the job should be dispatched.

void
acquireDebounceLock()

Acquire a debounce lock for the job and set its delay.

__call(string $method, array $parameters)

Dynamically proxy methods to the underlying job.

__destruct()

Handle the object's destruction.

catch(Closure $callback)

Add a callback to be executed if the job fails.

Details

in Conditionable at line 23
mixed when(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) truthy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

in Conditionable at line 56
mixed unless(mixed $value = null, callable|null $callback = null, callable|null $default = null)

Apply the callback if the given "value" is (or resolves to) falsy.

Parameters

mixed $value
callable|null $callback
callable|null $default

Return Value

mixed

protected mixed getAttributeValue(object $target, string $attributeClass, string|null $property = null, mixed $default = null)

Get a configuration value from an attribute, falling back to a property.

Parameters

object $target
string $attributeClass
string|null $property
mixed $default

Return Value

mixed

protected mixed extractAttributeValue(object $instance)

Extract the value from an attribute instance.

Parameters

object $instance

Return Value

mixed

protected object|null getAttributeInstance(object $target, string $attributeClass, ReflectionClass|null $declaringClass = null)

Get an instance of the given attribute class from the target class or its parents.

Parameters

object $target
string $attributeClass
ReflectionClass|null $declaringClass

Return Value

object|null

protected bool propertyOverridesAttribute(object $target, ReflectionClass $reflection, string|null $property, ReflectionClass $attributeDeclaringClass)

Determine if a property declared on a child class overrides an inherited attribute.

Parameters

object $target
ReflectionClass $reflection
string|null $property
ReflectionClass $attributeDeclaringClass

Return Value

bool

in PendingDispatch at line 36
__construct(mixed $job)

Create a new pending job dispatch.

Parameters

mixed $job

in PendingDispatch at line 44
PendingDispatch onConnection(UnitEnum|string|null $connection)

Set the desired connection for the job.

Parameters

UnitEnum|string|null $connection

Return Value

PendingDispatch

in PendingDispatch at line 54
PendingDispatch onQueue(UnitEnum|string|null $queue)

Set the desired queue for the job.

Parameters

UnitEnum|string|null $queue

Return Value

PendingDispatch

in PendingDispatch at line 66
PendingDispatch onGroup(array|UnitEnum|string|int|null $group)

Set the desired job message group.

This feature is only supported by some queues, such as Amazon SQS.

Parameters

array|UnitEnum|string|int|null $group

Return Value

PendingDispatch

in PendingDispatch at line 80
PendingDispatch withDeduplicator(array|callable|null $deduplicator)

Set the desired job deduplicator callback.

This feature is only supported by some queues, such as Amazon SQS FIFO.

Parameters

array|callable|null $deduplicator

Return Value

PendingDispatch

in PendingDispatch at line 90
PendingDispatch allOnConnection(UnitEnum|string|null $connection)

Set the desired connection for the chain.

Parameters

UnitEnum|string|null $connection

Return Value

PendingDispatch

in PendingDispatch at line 100
PendingDispatch allOnQueue(UnitEnum|string|null $queue)

Set the desired queue for the chain.

Parameters

UnitEnum|string|null $queue

Return Value

PendingDispatch

in PendingDispatch at line 110
PendingDispatch delay(DateInterval|DateTimeInterface|int|null $delay)

Set the desired delay in seconds for the job.

Parameters

DateInterval|DateTimeInterface|int|null $delay

Return Value

PendingDispatch

in PendingDispatch at line 120
PendingDispatch withoutDelay()

Set the delay for the job to zero seconds.

Return Value

PendingDispatch

in PendingDispatch at line 130
PendingDispatch afterCommit()

Indicate that the job should be dispatched after all database transactions have committed.

Return Value

PendingDispatch

in PendingDispatch at line 140
PendingDispatch beforeCommit()

Indicate that the job should not wait until database transactions have been committed before dispatching.

Return Value

PendingDispatch

in PendingDispatch at line 150
PendingDispatch chain(array $chain)

Set the jobs that should run if this job is successful.

Parameters

array $chain

Return Value

PendingDispatch

in PendingDispatch at line 160
PendingDispatch afterResponse(bool $afterResponse = true)

Indicate that the job should be dispatched after the response is sent to the browser.

Parameters

bool $afterResponse

Return Value

PendingDispatch

in PendingDispatch at line 170
mixed getJob()

Get the underlying job instance.

Return Value

mixed

in PendingDispatch at line 178
protected bool shouldDispatch()

Determine if the job should be dispatched.

Return Value

bool

in PendingDispatch at line 204
protected void acquireDebounceLock()

Acquire a debounce lock for the job and set its delay.

Return Value

void

Exceptions

LogicException

in PendingDispatch at line 226
PendingDispatch __call(string $method, array $parameters)

Dynamically proxy methods to the underlying job.

Parameters

string $method
array $parameters

Return Value

PendingDispatch

in PendingDispatch at line 236
__destruct()

Handle the object's destruction.

at line 14
PendingClosureDispatch catch(Closure $callback)

Add a callback to be executed if the job fails.

Parameters

Closure $callback

Return Value

PendingClosureDispatch