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.
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 15
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 44
protected mixed
extractAttributeValue(object $instance)
Extract the value from an attribute instance.
in
ReadsClassAttributes at line 54
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 70
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 15
string|null
resolveConnectionFromQueueRoute(object $queueable)
Resolve the default connection name for a given queueable instance.
in
ResolvesQueueRoutes at line 23
string|null
resolveQueueFromQueueRoute(object $queueable)
Resolve the default queue name for a given queueable instance.
in
ResolvesQueueRoutes at line 31
protected QueueRoutes
queueRoutes()
Get the queue routes manager instance.
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 121
void
bulk(iterable $jobs)
Dispatch multiple commands in bulk to their appropriate handlers on the queue.
at line 163
Batch|null
findBatch(string $batchId)
Attempt to find the batch with the given ID.
at line 171
PendingBatch
batch(mixed $jobs)
Create a new batch of queueable jobs.
at line 179
mixed
chain(mixed $jobs = null)
Create a new chain of queueable jobs.
at line 190
bool
hasCommandHandler(mixed $command)
Determine if the given command has a handler.
at line 200
mixed
getCommandHandler(mixed $command)
Retrieve the handler for a command.
at line 212
protected bool
commandShouldBeQueued(mixed $command)
Determine if the given command should be queued.
at line 222
mixed
dispatchToQueue(mixed $command)
Dispatch a command to its appropriate handler behind a queue.
at line 244
protected mixed
pushCommandToQueue(Queue $queue, mixed $command)
Push the command onto the given queue instance.
at line 262
void
dispatchAfterResponse(mixed $command, mixed $handler = null)
Dispatch a command to its appropriate handler after the current process.
at line 280
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 293
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 306
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 319
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.