class UniqueBroadcastEvent extends BroadcastEvent implements ShouldBeUnique

Traits

Properties

string|null $connection

The name of the connection the job should be sent to.

from  Queueable
string|null $queue

The name of the queue the job should be sent to.

from  Queueable
array|string|int|null $messageGroup

The message group the job should be sent to.

from  Queueable
null|array|callable $deduplicator

The deduplicator callback the job should use to generate the deduplication ID.

from  Queueable
string $debounceOwner

The lock owner token for debounce supersession checks.

from  Queueable
array|DateInterval|DateTimeInterface|int|null $delay

The number of seconds before the job should be made available.

from  Queueable
bool|null $afterCommit

Indicates whether the job should be dispatched after all database transactions have committed.

from  Queueable
array $middleware

The middleware the job should be dispatched through.

from  Queueable
array $chained

The jobs that should run if this job is successful.

from  Queueable
string|null $chainConnection

The name of the connection the chain should be sent to.

from  Queueable
string|null $chainQueue

The name of the queue the chain should be sent to.

from  Queueable
array|null $chainCatchCallbacks

The callbacks to be executed on chain failure.

from  Queueable
mixed $event

The event instance.

from  BroadcastEvent
int|null $tries

The number of times the job may be attempted.

from  BroadcastEvent
int|null $timeout

The number of seconds the job can run before timing out.

from  BroadcastEvent
array|int|null $backoff

The number of seconds to wait before retrying the job when encountering an uncaught exception.

from  BroadcastEvent
int|null $maxExceptions

The maximum number of unhandled exceptions to allow before failing.

from  BroadcastEvent
bool $deleteWhenMissingModels

Delete the job if its models no longer exist.

from  BroadcastEvent
string $uniqueId

The unique lock identifier.

int $uniqueFor

The number of seconds the unique lock should be maintained.

Methods

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(array|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.

through(array|object $middleware)

Specify the middleware the job should be dispatched through.

chain(array $chain)

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

prependToChain(mixed $job)

Prepend a job to the current chain so that it is run after the currently running job.

appendToChain(mixed $job)

Append a job to the end of the current chain.

string
serializeJob(mixed $job)

Serialize a job for queuing.

void
dispatchNextJobInChain()

Dispatch the next job on the chain.

void
invokeChainCatchCallbacks(Throwable|null $e)

Invoke all of the chain's failed job callbacks.

void
assertHasChain(array $expectedChain)

Assert that the job has the given chain of jobs attached to it.

void
assertDoesntHaveChain()

Assert that the job has no remaining chained jobs.

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 $event)

Create a new event instance.

void
handle(Factory $manager)

Handle the queued job.

array
getPayloadFromEvent(mixed $event)

Get the payload for the given event.

mixed
formatProperty(mixed $value)

Format the given value for a property.

array
getConnectionChannels(array $channels, string|null $connection)

Get the channels for the given connection.

array
getConnectionPayload(array $payload, string|null $connection)

Get the payload for the given connection.

array
middleware()

Get the middleware for the underlying event.

void
failed(Throwable|null $e = null)

Handle a job failure.

string
displayName()

Get the display name for the queued job.

__clone()

Prepare the instance for cloning.

uniqueVia()

Resolve the cache implementation that should manage the event's uniqueness.

Details

in Queueable at line 92
Queueable onConnection(UnitEnum|string|null $connection)

Set the desired connection for the job.

Parameters

UnitEnum|string|null $connection

Return Value

Queueable

in Queueable at line 104
Queueable onQueue(UnitEnum|string|null $queue)

Set the desired queue for the job.

Parameters

UnitEnum|string|null $queue

Return Value

Queueable

in Queueable at line 118
Queueable 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

Queueable

in Queueable at line 130
Queueable 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

Queueable

in Queueable at line 142
Queueable allOnConnection(UnitEnum|string|null $connection)

Set the desired connection for the chain.

Parameters

UnitEnum|string|null $connection

Return Value

Queueable

in Queueable at line 157
Queueable allOnQueue(UnitEnum|string|null $queue)

Set the desired queue for the chain.

Parameters

UnitEnum|string|null $queue

Return Value

Queueable

in Queueable at line 172
Queueable delay(array|DateInterval|DateTimeInterface|int|null $delay)

Set the desired delay in seconds for the job.

Parameters

array|DateInterval|DateTimeInterface|int|null $delay

Return Value

Queueable

in Queueable at line 182
Queueable withoutDelay()

Set the delay for the job to zero seconds.

Return Value

Queueable

in Queueable at line 192
Queueable afterCommit()

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

Return Value

Queueable

in Queueable at line 202
Queueable beforeCommit()

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

Return Value

Queueable

in Queueable at line 212
Queueable through(array|object $middleware)

Specify the middleware the job should be dispatched through.

Parameters

array|object $middleware

Return Value

Queueable

in Queueable at line 222
Queueable chain(array $chain)

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

Parameters

array $chain

Return Value

Queueable

in Queueable at line 234
Queueable prependToChain(mixed $job)

Prepend a job to the current chain so that it is run after the currently running job.

Parameters

mixed $job

Return Value

Queueable

in Queueable at line 248
Queueable appendToChain(mixed $job)

Append a job to the end of the current chain.

Parameters

mixed $job

Return Value

Queueable

in Queueable at line 264
protected string serializeJob(mixed $job)

Serialize a job for queuing.

Parameters

mixed $job

Return Value

string

Exceptions

RuntimeException

in Queueable at line 282
void dispatchNextJobInChain()

Dispatch the next job on the chain.

Return Value

void

in Queueable at line 305
void invokeChainCatchCallbacks(Throwable|null $e)

Invoke all of the chain's failed job callbacks.

Parameters

Throwable|null $e

Return Value

void

in Queueable at line 315
void assertHasChain(array $expectedChain)

Assert that the job has the given chain of jobs attached to it.

Parameters

array $expectedChain

Return Value

void

in Queueable at line 337
void assertDoesntHaveChain()

Assert that the job has no remaining chained jobs.

Return Value

void

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

at line 26
__construct(mixed $event)

Create a new event instance.

Parameters

mixed $event

in BroadcastEvent at line 74
void handle(Factory $manager)

Handle the queued job.

Parameters

Factory $manager

Return Value

void

in BroadcastEvent at line 104
protected array getPayloadFromEvent(mixed $event)

Get the payload for the given event.

Parameters

mixed $event

Return Value

array

in BroadcastEvent at line 126
protected mixed formatProperty(mixed $value)

Format the given value for a property.

Parameters

mixed $value

Return Value

mixed

in BroadcastEvent at line 138
protected array getConnectionChannels(array $channels, string|null $connection)

Get the channels for the given connection.

Parameters

array $channels
string|null $connection

Return Value

array

in BroadcastEvent at line 148
protected array getConnectionPayload(array $payload, string|null $connection)

Get the payload for the given connection.

Parameters

array $payload
string|null $connection

Return Value

array

in BroadcastEvent at line 166
array middleware()

Get the middleware for the underlying event.

Return Value

array

in BroadcastEvent at line 178
void failed(Throwable|null $e = null)

Handle a job failure.

Parameters

Throwable|null $e

Return Value

void

in BroadcastEvent at line 190
string displayName()

Get the display name for the queued job.

Return Value

string

in BroadcastEvent at line 198
__clone()

Prepare the instance for cloning.

at line 46
Repository uniqueVia()

Resolve the cache implementation that should manage the event's uniqueness.

Return Value

Repository