Documentation

LockingMiddleware
in package
implements Middleware

If another command is already being executed, locks the command bus and queues the new incoming commands until the first has completed.

Table of Contents

Interfaces

Middleware
Middleware are the plugins of Tactician. They receive each command that's given to the CommandBus and can take any action they choose. Middleware can continue the Command processing by passing the command they receive to the $next callable, which is essentially the "next" Middleware in the chain.

Properties

$isExecuting  : bool
$queue  : array<string|int, callable>

Methods

execute()  : mixed|void
Execute the given command... after other running commands are complete.
executeQueuedJobs()  : mixed
Process any pending commands in the queue. If multiple, jobs are in the queue, only the first return value is given back.

Properties

Methods

execute()

Execute the given command... after other running commands are complete.

public execute(object $command, callable $next) : mixed|void
Parameters
$command : object
$next : callable
Tags
throws
Throwable
Return values
mixed|void

executeQueuedJobs()

Process any pending commands in the queue. If multiple, jobs are in the queue, only the first return value is given back.

protected executeQueuedJobs() : mixed

        
On this page

Search results