Skip to content

TransactionalCommandLockingDecorator

TransactionalCommandLockingDecorator treats commands as transactions. Meaning that any subsequent Commands passed to the bus from inside the relevant CommandHandler will not be executed until the initial command is completed.

Properties

locked

Whether a Command is in progress and the bus is locked.

protected bool $locked

queue

Queued Commands to be executed when the current command finishes.

protected array $queue

Methods

__construct

public __construct(?\Codefy\CommandBus\CommandBus $innerCommandBus = null): mixed

Parameters:

Parameter Type Description
$innerCommandBus ?\Codefy\CommandBus\CommandBus

execute

Execute a command

public execute(\Codefy\CommandBus\Command $command): mixed

Parameters:

Parameter Type Description
$command \Codefy\CommandBus\Command

executeIgnoringLock

Execute a command, regardless of the lock

protected executeIgnoringLock(\Codefy\CommandBus\Command $command): mixed

Parameters:

Parameter Type Description
$command \Codefy\CommandBus\Command

executeQueue

Execute all queued commands

protected executeQueue(): void

Inherited methods

setInnerBus

public setInnerBus(\Codefy\CommandBus\CommandBus $bus): void

Parameters:

Parameter Type Description
$bus \Codefy\CommandBus\CommandBus


Automatically generated on 2025-10-13