FixAlchemy.SessionStatus (FIXAlchemy v0.2.0)
View SourceTracks the live status of every named FIX session of a connection, including the last error that took a session down — e.g. the Text from a Logout rejecting a logon.
Backed by a public ETS table so client processes can record transitions without going through this process. All operations are safe no-ops when the table is not running (e.g. standalone Livebook usage).
Summary
Functions
Every session of connection_id that has a recorded status, by name.
Returns a specification to start this module under a supervisor.
Forget every session of connection_id.
Types
@type session_name() :: FixAlchemy.SessionConfig.name()
@type session_state() :: :connecting | :connected | :logged_in | :down
@type status() :: %{state: session_state(), error: term() | nil, at: DateTime.t()}
Functions
@spec all(String.t()) :: %{required(session_name()) => status()}
Every session of connection_id that has a recorded status, by name.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec clear(String.t()) :: :ok
Forget every session of connection_id.
Broadcasts each forgotten session as :down with reason :disconnected.
@spec get(String.t() | nil, session_name()) :: status() | nil
@spec mark_down(String.t() | nil, session_name(), term()) :: :ok
@spec put(String.t() | nil, session_name(), session_state(), term() | nil) :: :ok
@spec start_link(term()) :: GenServer.on_start()