Outbox.Registry (Outbox v0.1.0-beta.1)

Copy Markdown View Source

Resolves event names to subscriber modules.

Reads subscribers from Outbox.Config.subscribers/0 on every lookup. No GenServer, no ETS cache — the dispatcher polls every 5 seconds, so the lookup happens at most a few times per second per node; caching would not be a meaningful optimization at this volume.

Trivial-by-design also means tests can override the subscriber list with Application.put_env/3 without restarting the application.

Summary

Functions

Returns the list of subscriber modules listening for the given event name. Returns [] if no subscribers match.

Returns the full list of registered subscriber modules.

Functions

lookup(event_name)

@spec lookup(String.t()) :: [module()]

Returns the list of subscriber modules listening for the given event name. Returns [] if no subscribers match.

subscribers()

@spec subscribers() :: [module()]

Returns the full list of registered subscriber modules.