FixAlchemy.SessionDirectory (FIXAlchemy v0.3.0)
View SourceThe sessions a connection is running, and the roles each one serves.
Every session registers its supervisor under {connection_id, name, :supervisor} with its roles as the registration value, so the sessions of a
connection and their purposes are read from the registry rather than from the
connection's config, and are forgotten the moment a session stops.
Names are returned sorted, so a role that two sessions declare resolves to the same one on every call.
Summary
Functions
The names of every running session of connection_id, sorted.
The name of the session serving role.
The roles session name of connection_id serves.
The {name, roles} of every running session of connection_id.
Functions
@spec names(binary()) :: [FixAlchemy.SessionConfig.name()]
The names of every running session of connection_id, sorted.
@spec resolve(binary(), FixAlchemy.SessionConfig.role()) :: {:ok, FixAlchemy.SessionConfig.name()} | :error
The name of the session serving role.
Falls back to a session serving :trading when none declares role, so a
connection with no session of its own for a purpose uses its trading session
for it. Returns :error when neither exists.
@spec roles(binary(), FixAlchemy.SessionConfig.name()) :: [ FixAlchemy.SessionConfig.role() ]
The roles session name of connection_id serves.
@spec sessions(binary()) :: [ {FixAlchemy.SessionConfig.name(), [FixAlchemy.SessionConfig.role()]} ]
The {name, roles} of every running session of connection_id.