Dispatcher

class Dispatcher implements QueueingDispatcher (View source)

Properties

protected Container $container The container implementation.
protected Pipeline $pipeline The pipeline instance for the bus.
protected array $pipes The pipes to send commands through before dispatching.
protected Closure|null $queueResolver The queue resolver callback.

Methods

void __construct(Container $container, Closure $queueResolver = null)

Create a new command dispatcher instance.

mixed dispatch(mixed $command)

Dispatch a command to its appropriate handler.

mixed dispatchNow(mixed $command)

Dispatch a command to its appropriate handler in the current process.

bool commandShouldBeQueued(mixed $command)

Determine if the given command should be queued.

mixed dispatchToQueue(mixed $command)

Dispatch a command to its appropriate handler behind a queue.

mixed pushCommandToQueue(Queue $queue, mixed $command)

Push the command onto the given queue instance.

$this pipeThrough(array $pipes)

Set the pipes through which commands should be piped before dispatching.

Details

void __construct(Container $container, Closure $queueResolver = null)

Create a new command dispatcher instance.

Parameters

Container $container
Closure $queueResolver

Return Value

void

mixed dispatch(mixed $command)

Dispatch a command to its appropriate handler.

Parameters

mixed $command

Return Value

mixed

mixed dispatchNow(mixed $command)

Dispatch a command to its appropriate handler in the current process.

Parameters

mixed $command

Return Value

mixed

protected bool commandShouldBeQueued(mixed $command)

Determine if the given command should be queued.

Parameters

mixed $command

Return Value

bool

mixed dispatchToQueue(mixed $command)

Dispatch a command to its appropriate handler behind a queue.

Parameters

mixed $command

Return Value

mixed

Exceptions

RuntimeException

protected mixed pushCommandToQueue(Queue $queue, mixed $command)

Push the command onto the given queue instance.

Parameters

Queue $queue
mixed $command

Return Value

mixed

$this pipeThrough(array $pipes)

Set the pipes through which commands should be piped before dispatching.

Parameters

array $pipes

Return Value

$this

© Taylor Otwell
Licensed under the MIT License.
Laravel is a trademark of Taylor Otwell.
https://laravel.com/api/5.2/Illuminate/Bus/Dispatcher.html