QueueRoutes
class QueueRoutes (View source)
Traits
Properties
| protected array<class-string, array|string> | $routes | The mapping of class names to their default routes. |
|
| protected array<string, array> | $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.
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
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.
protected mixed
extractAttributeValue(object $instance)
Extract the value from an attribute instance.
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.
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.
string|null
getConnection(object $queueable)
Get the queue connection that a given queueable instance should be routed to.
protected string|null
forwardedConnection(UnitEnum|string|null $queue)
Get the connection the given queue has been forwarded to.
string|null
getQueue(object $queueable)
Get the queue that a given queueable instance should be routed to.
string
forwardedQueue(string $queue, string|null $connection = null)
Get the queue the given queue has been forwarded to.
array|string|null
getRoute(object $queueable)
Get the route for a given queueable instance.
void
set(array|string $class, UnitEnum|string|null $queue = null, UnitEnum|string|null $connection = null)
Register the queue route for the given class.
void
forward(UnitEnum|array|string $queue, UnitEnum|string|null $to = null, UnitEnum|string|null $connection = null)
Register a forward for the given queue.
array<class-string, array|string>
all()
Get all registered queue routes.