Execution Modes
PHP Event Sourcing Projection Execution Modes
The Problem
Choosing the Right Mode
Feature
Sync Event-Driven
Async Event-Driven
Polling (Enterprise)
Synchronous Event-Driven (Default)
#[ProjectionV2('ticket_list')]
#[FromAggregateStream(Ticket::class)]
class TicketListProjection
{
// No additional attributes needed — synchronous is the default
#[EventHandler]
public function onTicketRegistered(TicketWasRegistered $event): void
{
// This runs in the same transaction as the command
}
}Asynchronous Event-Driven
Batch Size and Flushing
How Batching Works
Polling (Enterprise)
Last updated
Was this helpful?