Dispatcher (Bus)

Dispatcher

class Dispatcher implements Dispatcher, QueueingDispatcher, HandlerResolver (View source)

Methods

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

Create a new command dispatcher instance.

mixed dispatchFromArray( mixed $command, array $array)

Marshal a command and dispatch it to its appropriate handler.

mixed dispatchFrom( mixed $command, ArrayAccess $source, array $extras = array())

Marshal a command and dispatch it to its appropriate handler.

mixed dispatch( mixed $command, Closure $afterResolving = null)

Dispatch a command to its appropriate handler.

mixed dispatchNow( mixed $command, Closure $afterResolving = null)

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

mixed dispatchToQueue( mixed $command)

Dispatch a command to its appropriate handler behind a queue.

mixed resolveHandler( mixed $command)

Get the handler instance for the given command.

string getHandlerClass( mixed $command)

Get the handler class for the given command.

string getHandlerMethod( mixed $command)

Get the handler method for the given command.

void maps( array $commands)

Register command-to-handler mappings.

void mapUsing( Closure $mapper)

Register a fallback mapper callback.

static string simpleMapping( mixed $command, string $commandNamespace, string $handlerNamespace)

Map the command to a handler within a given root namespace.

$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 dispatchFromArray( mixed $command, array $array)

Marshal a command and dispatch it to its appropriate handler.

Parameters

mixed $command
array $array

Return Value

mixed

mixed dispatchFrom( mixed $command, ArrayAccess $source, array $extras = array())

Marshal a command and dispatch it to its appropriate handler.

Parameters

mixed $command
ArrayAccess $source
array $extras

Return Value

mixed

mixed dispatch( mixed $command, Closure $afterResolving = null)

Dispatch a command to its appropriate handler.

Parameters

mixed $command
Closure $afterResolving

Return Value

mixed

mixed dispatchNow( mixed $command, Closure $afterResolving = null)

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

Parameters

mixed $command
Closure $afterResolving

Return Value

mixed

mixed dispatchToQueue( mixed $command)

Dispatch a command to its appropriate handler behind a queue.

Parameters

mixed $command

Return Value

mixed

Exceptions

RuntimeException

mixed resolveHandler( mixed $command)

Get the handler instance for the given command.

Parameters

mixed $command

Return Value

mixed

string getHandlerClass( mixed $command)

Get the handler class for the given command.

Parameters

mixed $command

Return Value

string

string getHandlerMethod( mixed $command)

Get the handler method for the given command.

Parameters

mixed $command

Return Value

string

void maps( array $commands)

Register command-to-handler mappings.

Parameters

array $commands

Return Value

void

void mapUsing( Closure $mapper)

Register a fallback mapper callback.

Parameters

Closure $mapper

Return Value

void

static string simpleMapping( mixed $command, string $commandNamespace, string $handlerNamespace)

Map the command to a handler within a given root namespace.

Parameters

mixed $command
string $commandNamespace
string $handlerNamespace

Return Value

string

$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.1/Illuminate/Bus/Dispatcher.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部