Dispatcher
class Dispatcher implements QueueingDispatcher
Traits
Properties
| protected Pipeline | $pipeline | The pipeline instance for the bus. |
|
| protected array | $pipes | The pipes to send commands through before dispatching. |
|
| protected array | $handlers | The command to handler mapping for non-self-handling events. |
|
| protected bool | $allowsDispatchingAfterResponses | Indicate if dispatching after response is disabled. |
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.
Resolve the default connection name for a given queueable instance.
Resolve the default queue name for a given queueable instance.
Get the container that owns the queue routes.
Create a new command dispatcher instance.
Dispatch a command to its appropriate handler.
Dispatch a command to its appropriate handler in the current process.
Dispatch a command to its appropriate handler in the current process without using the synchronous queue.
Dispatch multiple commands in bulk to their appropriate handlers on the queue.
Create a new batch of queueable jobs.
Create a new chain of queueable jobs.
Determine if the given command has a handler.
Retrieve the handler for a command.
Determine if the given command should be queued.
Dispatch a command to its appropriate handler behind a queue.
Dispatch a command to its appropriate handler after the current process.
Set the pipes through which commands should be piped before dispatching.
Map a command to a handler.
Allow dispatching after responses.
Disable dispatching after responses.
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.
in
ResolvesQueueRoutes at line 19
string|null
resolveConnectionFromQueueRoute(object $queueable, UnitEnum|string|null $queue = null)
Resolve the default connection name for a given queueable instance.
in
ResolvesQueueRoutes at line 27
string|null
resolveQueueFromQueueRoute(object $queueable)
Resolve the default queue name for a given queueable instance.
in
ResolvesQueueRoutes at line 35
protected QueueRoutes
queueRoutes()
Get the queue routes manager instance.
at line 291
protected Container
queueRoutesContainer()
Get the container that owns the queue routes.
at line 53
__construct(Container $container, Closure|null $queueResolver = null)
Create a new command dispatcher instance.
at line 63
mixed
dispatch(mixed $command)
Dispatch a command to its appropriate handler.
at line 75
mixed
dispatchSync(mixed $command, mixed $handler = null)
Dispatch a command to its appropriate handler in the current process.
Queueable jobs will be dispatched to the "sync" queue.
at line 90
mixed
dispatchNow(mixed $command, mixed $handler = null)
Dispatch a command to its appropriate handler in the current process without using the synchronous queue.
at line 122
void
bulk(iterable $jobs)
Dispatch multiple commands in bulk to their appropriate handlers on the queue.
at line 164
Batch|null
findBatch(string $batchId)
Attempt to find the batch with the given ID.
at line 172
PendingBatch
batch(mixed $jobs)
Create a new batch of queueable jobs.
at line 180
mixed
chain(mixed $jobs = null)
Create a new chain of queueable jobs.
at line 191
bool
hasCommandHandler(mixed $command)
Determine if the given command has a handler.
at line 199
mixed
getCommandHandler(mixed $command)
Retrieve the handler for a command.
at line 211
protected bool
commandShouldBeQueued(mixed $command)
Determine if the given command should be queued.
at line 221
mixed
dispatchToQueue(mixed $command)
Dispatch a command to its appropriate handler behind a queue.
at line 243
protected mixed
pushCommandToQueue(Queue $queue, mixed $command)
Push the command onto the given queue instance.
at line 261
void
dispatchAfterResponse(mixed $command, mixed $handler = null)
Dispatch a command to its appropriate handler after the current process.
at line 303
Dispatcher
pipeThrough(array $pipes)
Set the pipes through which commands should be piped before dispatching.
Boot-only. The pipes persist on the singleton dispatcher for the worker lifetime and apply to every subsequent dispatch; per-request use races across coroutines.
at line 316
Dispatcher
map(array $map)
Map a command to a handler.
Boot-only. The handler map persists on the singleton dispatcher for the worker lifetime; per-request use races across coroutines.
at line 329
Dispatcher
withDispatchingAfterResponses()
Allow dispatching after responses.
Boot-only. Toggles a flag on the singleton dispatcher for the worker lifetime; per-request use races across coroutines.
at line 342
Dispatcher
withoutDispatchingAfterResponses()
Disable dispatching after responses.
Boot-only. Toggles a flag on the singleton dispatcher for the worker lifetime; per-request use races across coroutines.