0

Final Class Yiisoft\Queue\Middleware\Push\PushMiddlewareDispatcher

InheritanceYiisoft\Queue\Middleware\Push\PushMiddlewareDispatcher

Public Methods

Hide inherited methods

Method Description Defined By
__construct() Yiisoft\Queue\Middleware\Push\PushMiddlewareDispatcher
dispatch() Dispatch message through middleware to get response. Yiisoft\Queue\Middleware\Push\PushMiddlewareDispatcher

Method Details

Hide inherited methods

__construct() public method

public mixed __construct ( Yiisoft\Queue\Middleware\Push\PushMiddlewareFactoryInterface $middlewareFactory, array $middlewareDefinitions, Yiisoft\Queue\Middleware\Push\PushHandlerInterface $finalHandler )
$middlewareFactory Yiisoft\Queue\Middleware\Push\PushMiddlewareFactoryInterface

Factory used to instantiate middleware.

$middlewareDefinitions array

Middleware definitions.

$finalHandler Yiisoft\Queue\Middleware\Push\PushHandlerInterface

Handler invoked after all middlewares are processed.

                public function __construct(
    private readonly PushMiddlewareFactoryInterface $middlewareFactory,
    private readonly array $middlewareDefinitions,
    private readonly PushHandlerInterface $finalHandler,
) {}

            
dispatch() public method

Dispatch message through middleware to get response.

public Yiisoft\Queue\Message\MessageInterface dispatch ( Yiisoft\Queue\Message\MessageInterface $message )
$message Yiisoft\Queue\Message\MessageInterface

Message to pass to middleware.

                public function dispatch(MessageInterface $message): MessageInterface
{
    $this->stack ??= new PushMiddlewareStack($this->buildMiddlewares(), $this->finalHandler);
    return $this->stack->handlePush($message);
}