W3cubDocs

/Laravel 5.4

Dispatcher

class Dispatcher implements QueueingDispatcher (View source)

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, mixed $handler = null)

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

bool hasCommandHandler(mixed $command)

Determine if the given command has a handler.

bool|mixed getCommandHandler(mixed $command)

Retrieve the handler for a command.

mixed dispatchToQueue(mixed $command)

Dispatch a command to its appropriate handler behind a queue.

$this pipeThrough(array $pipes)

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

$this map(array $map)

Map a command to a handler.

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, mixed $handler = null)

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

Parameters

mixed $command
mixed $handler

Return Value

mixed

bool hasCommandHandler(mixed $command)

Determine if the given command has a handler.

Parameters

mixed $command

Return Value

bool

bool|mixed getCommandHandler(mixed $command)

Retrieve the handler for a command.

Parameters

mixed $command

Return Value

bool|mixed

mixed dispatchToQueue(mixed $command)

Dispatch a command to its appropriate handler behind a queue.

Parameters

mixed $command

Return Value

mixed

Exceptions

RuntimeException

$this pipeThrough(array $pipes)

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

Parameters

array $pipes

Return Value

$this

$this map(array $map)

Map a command to a handler.

Parameters

array $map

Return Value

$this

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