Dispatcher
Implements
Properties
$pipes array
The pipes to send commands through before dispatching.
$handlers array
The command to handler mapping for non-self-handling events.
Methods
__construct ( Container $container , Closure $queueResolver ) : void
Create a new command dispatcher instance.
Parameters
dispatch ( $command ) : mixed
Dispatch a command to its appropriate handler.
Parameters
- $command mixed
dispatchSync ( $command , $handler ) : mixed
Dispatch a command to its appropriate handler in the current process.
Parameters
- $command mixed
- $handler mixed
dispatchNow ( $command , $handler ) : mixed
Dispatch a command to its appropriate handler in the current process without using the synchronous queue.
Parameters
- $command mixed
- $handler mixed
findBatch ( string $batchId ) : Batch |null
Attempt to find the batch with the given ID.
Parameters
- $batchId string
batch ( $jobs ) : PendingBatch
Create a new batch of queueable jobs.
Parameters
- $jobs Collection |array|mixed
chain ( $jobs ) : PendingChain
Create a new chain of queueable jobs.
Parameters
- $jobs Collection |array
hasCommandHandler ( $command ) : bool
Determine if the given command has a handler.
Parameters
- $command mixed
getCommandHandler ( $command ) : bool|mixed
Retrieve the handler for a command.
Parameters
- $command mixed
commandShouldBeQueued ( $command ) : bool
Determine if the given command should be queued.
Parameters
- $command mixed
dispatchToQueue ( $command ) : mixed
Dispatch a command to its appropriate handler behind a queue.
Parameters
- $command mixed
pushCommandToQueue ( $queue , $command ) : mixed
Push the command onto the given queue instance.
Parameters
- $queue Queue
- $command mixed
dispatchAfterResponse ( $command , $handler ) : void
Dispatch a command to its appropriate handler after the current process.
Parameters
- $command mixed
- $handler mixed
pipeThrough ( array $pipes ) : $this
Set the pipes through which commands should be piped before dispatching.
Parameters
- $pipes array
map ( array $map ) : $this
Map a command to a handler.
Parameters
- $map array