Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Event handler concurrency #184
Allow event handlers to specify how many processes are started to allow handling events concurrently.
The behaviour is similar to Greg's Event Store which uses the competing consumer pattern. Increasing the concurrency means the event ordering guarantee is lost since events will be handled out-of-order. To alleviate this issue an optional partitioning function may be provided to ensure events are processed in order where necessary (e.g. per aggregate identity).
defmodule ExampleHandler do use Commanded.Event.Handler, name: "ExampleHandler", concurrency: 10, partition_by: fn _event, metadata -> metadata.stream_id end def handle(_event, _metadata) do :ok end end
This feature depends upon Subscription concurrency (#124) to be implemented in the Elixir Event Store. Greg's Event Store already has support for concurrency.
Does it represent the maximum of events handled at the same time?