ETS-backed registry that maps event type strings to their modules.
Started automatically by Counterpoint.Supervisor. Pass the list of event
modules via the events: option so they are registered at startup and can
be deserialized when reading from the store.
Example (via supervisor)
Counterpoint.Supervisor.start_link(
store: [name: :my_store, namespace: "my_app"],
events: [MyApp.Events.OrderPlaced, MyApp.Events.OrderCancelled]
)Manual registration (testing / hot-reloading)
Counterpoint.EventRegistry.register_all([MyApp.Events.OrderPlaced])
Summary
Functions
Returns a specification to start this module under a supervisor.
Look up the module for a given type string.
Register a list of event modules so they can be deserialized by type string.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
Look up the module for a given type string.
Returns {:ok, module} or {:error, :unknown_type}.
Register a list of event modules so they can be deserialized by type string.