QueueRoutes
class QueueRoutes
Traits
Properties
| protected array<class-string, array{null|string, null|string}|string> | $routes | The mapping of class names to their default routes. |
|
| protected array<array-key, array{null|string, null|string}> | $forwards | The queues that have been forwarded to another queue and/or connection. |
Methods
Get a configuration value from an attribute, falling back to a property.
Extract the value from an attribute instance.
Get an instance of the given attribute class from the target class or its parents.
Determine if a property declared on a child class overrides an inherited attribute.
Get the queue connection that a given queueable instance should be routed to.
Get the connection the given queue has been forwarded to.
Get the queue that a given queueable instance should be routed to.
Get the queue the given queue has been forwarded to.
Apply only forwards explicitly scoped to the given connection.
Get the route for a given queueable instance.
Register the queue route for the given class.
Register a forward for the given queue.
Get all registered queue routes.
Details
in
ReadsClassAttributes at line 17
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.
in
ReadsClassAttributes at line 46
protected mixed
extractAttributeValue(object $instance)
Extract the value from an attribute instance.
in
ReadsClassAttributes at line 58
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.
in
ReadsClassAttributes at line 74
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.
at line 37
string|null
getConnection(object $queueable, UnitEnum|string|null $queue = null)
Get the queue connection that a given queueable instance should be routed to.
at line 58
protected string|null
forwardedConnection(UnitEnum|string|null $queue)
Get the connection the given queue has been forwarded to.
at line 70
string|null
getQueue(object $queueable)
Get the queue that a given queueable instance should be routed to.
at line 86
string
forwardedQueue(string $queue, string|null $connection = null)
Get the queue the given queue has been forwarded to.
at line 102
string
forwardedQueueForConnection(string $queue, string|null $connection)
Apply only forwards explicitly scoped to the given connection.
at line 114
array|string|null
getRoute(object $queueable)
Get the route for a given queueable instance.
at line 144
void
set(array|string $class, UnitEnum|string|null $queue = null, UnitEnum|string|null $connection = null)
Register the queue route for the given class.
The route persists on the singleton registry for the worker lifetime and affects every subsequent dispatch of that class.
at line 167
void
forward(UnitEnum|array|string $queue, UnitEnum|string|null $to = null, UnitEnum|string|null $connection = null)
Register a forward for the given queue.
Forwards persist on the singleton registry for the worker lifetime and affect every subsequent dispatch and queue operation.
at line 185
array
all()
Get all registered queue routes.