FixAlchemy.SessionSupervisor (FIXAlchemy v0.2.1)

View Source

Per-session supervision tree for one FIX connection.

Supervises the session Client for a single {connection_id, session_name} pair, alongside any per-session subscriber processes the caller supplies via the :handlers option. The client starts first; the subscribers follow and register their interest with it. Under :rest_for_one, a subscriber that crashes restarts alone, while a client restart also restarts the subscribers after it — so they re-subscribe against the fresh session.

The session is named by :session_name (default :trading) and serves the roles given by :session_roles (default [:trading, :market_data]), which are the value of its registry entry — the source FixAlchemy.SessionDirectory resolves a role against.

:handlers is a list of modules (or child specs); each module receives the full connection opts. The generic engine ships no handlers — a broker adapter supplies its own (e.g. handshake, market-data, and portfolio subscribers).

The connection's dictionary is built before any child starts. A dictionary that cannot be built fails the start with that reason.

Summary

Functions

Returns a specification to start this module under a supervisor.

Functions

child_spec(init_arg)

@spec child_spec(keyword()) :: Supervisor.child_spec()

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts)

@spec start_link(keyword()) :: Supervisor.on_start()

stop(connection_id, session_name)

@spec stop(binary(), FixAlchemy.SessionConfig.name()) :: :ok