Dispatcher.php
62 lines
| 1 | <?php |
| 2 | |
| 3 | namespace IAWPSCOPED\Illuminate\Contracts\Bus; |
| 4 | |
| 5 | /** @internal */ |
| 6 | interface Dispatcher |
| 7 | { |
| 8 | /** |
| 9 | * Dispatch a command to its appropriate handler. |
| 10 | * |
| 11 | * @param mixed $command |
| 12 | * @return mixed |
| 13 | */ |
| 14 | public function dispatch($command); |
| 15 | /** |
| 16 | * Dispatch a command to its appropriate handler in the current process. |
| 17 | * |
| 18 | * Queueable jobs will be dispatched to the "sync" queue. |
| 19 | * |
| 20 | * @param mixed $command |
| 21 | * @param mixed $handler |
| 22 | * @return mixed |
| 23 | */ |
| 24 | public function dispatchSync($command, $handler = null); |
| 25 | /** |
| 26 | * Dispatch a command to its appropriate handler in the current process. |
| 27 | * |
| 28 | * @param mixed $command |
| 29 | * @param mixed $handler |
| 30 | * @return mixed |
| 31 | */ |
| 32 | public function dispatchNow($command, $handler = null); |
| 33 | /** |
| 34 | * Determine if the given command has a handler. |
| 35 | * |
| 36 | * @param mixed $command |
| 37 | * @return bool |
| 38 | */ |
| 39 | public function hasCommandHandler($command); |
| 40 | /** |
| 41 | * Retrieve the handler for a command. |
| 42 | * |
| 43 | * @param mixed $command |
| 44 | * @return bool|mixed |
| 45 | */ |
| 46 | public function getCommandHandler($command); |
| 47 | /** |
| 48 | * Set the pipes commands should be piped through before dispatching. |
| 49 | * |
| 50 | * @param array $pipes |
| 51 | * @return $this |
| 52 | */ |
| 53 | public function pipeThrough(array $pipes); |
| 54 | /** |
| 55 | * Map a command to a handler. |
| 56 | * |
| 57 | * @param array $map |
| 58 | * @return $this |
| 59 | */ |
| 60 | public function map(array $map); |
| 61 | } |
| 62 |