Bourse.WS.HandlerMappings (bourse v0.1.0)

Copy Markdown View Source

Maps Bourse Pro handle* method names to unified watch_* family atoms.

Non-family handlers (auth, pong, subscription management) map to :system.

Summary

Functions

Returns all families a handler dispatches to (composite handlers may return multiple).

Returns the primary family for a handler, or nil for non-family handlers.

Returns the known watch family atoms.

Resolves a handler method name to a watch family or :system.

Types

resolve_result()

@type resolve_result() :: {:family, atom()} | :system | :not_found

Functions

handler_to_families(handler_name)

@spec handler_to_families(String.t()) :: [atom()]

Returns all families a handler dispatches to (composite handlers may return multiple).

handler_to_family(handler_name)

@spec handler_to_family(String.t()) :: atom() | nil

Returns the primary family for a handler, or nil for non-family handlers.

known_families()

@spec known_families() :: [atom()]

Returns the known watch family atoms.

resolve_handler(handler_name)

@spec resolve_handler(String.t() | nil) :: resolve_result()

Resolves a handler method name to a watch family or :system.