Asynchronous Message Bus (Gateways)
Asynchronous Message Bus Gateways for channel-wide async processing
Last updated
Was this helpful?
Was this helpful?
#[CommandHandler]
public function placeOrder(PlaceOrderCommand $command) : void
{
// do something with $command
}#[Asynchronous("outbox")]
interface OutboxEventBus extends EventBus {}#[ServiceContext]
public function orderChannel()
{
return DbalBackedMessageChannelBuilder::create("orders");
}#[CommandHandler]
public function placeOrder(PlaceOrderCommand $command, OutboxEventBus $eventBus) : void
{
// do something with $command
$eventBus->publish(new OrderWasPlaced());
}