Connection runtime supervisor with rc.9-style socket, store, and event layers.
Summary
Functions
Return a child pid by supervisor child id.
Returns a specification to start this module under a supervisor.
Return the coordinator pid when present.
Return the event emitter pid when present.
Return the {socket_module, socket_pid} transport tuple used by feature helpers.
Request a pairing code through the active socket.
Send a message through the coordinator-managed send pipeline.
Send a status message through the coordinator-managed send pipeline.
Send a WAM analytics buffer through the active socket.
Return the wrapped Signal store for the connection when present.
Start a connection runtime from an auth state payload.
Start the supervisor and its subtree of runtime connection processes.
Stop a running connection runtime.
Return the connection store pid when present.
Subscribe to raw event maps emitted by the connection runtime.
Safely returns the child specifications for the active connection supervisor subtree.
Functions
@spec child_pid(GenServer.server(), term()) :: pid() | nil
Return a child pid by supervisor child id.
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec coordinator(GenServer.server()) :: pid() | nil
Return the coordinator pid when present.
@spec event_emitter(GenServer.server()) :: pid() | nil
Return the event emitter pid when present.
@spec queryable(GenServer.server()) :: {module(), pid()} | nil
Return the {socket_module, socket_pid} transport tuple used by feature helpers.
@spec request_pairing_code(GenServer.server(), binary(), keyword()) :: {:ok, binary()} | {:error, term()}
Request a pairing code through the active socket.
@spec send_message(GenServer.server(), BaileysEx.JID.t(), map() | struct(), keyword()) :: {:ok, map()} | {:error, term()}
Send a message through the coordinator-managed send pipeline.
@spec send_status(GenServer.server(), map(), keyword()) :: {:ok, map()} | {:error, term()}
Send a status message through the coordinator-managed send pipeline.
@spec send_wam_buffer(GenServer.server(), binary()) :: {:ok, BaileysEx.BinaryNode.t()} | {:error, term()}
Send a WAM analytics buffer through the active socket.
@spec signal_store(GenServer.server()) :: BaileysEx.Signal.Store.t() | nil
Return the wrapped Signal store for the connection when present.
@spec start_connection( term(), keyword() ) :: Supervisor.on_start()
Start a connection runtime from an auth state payload.
@spec start_link(keyword()) :: Supervisor.on_start()
Start the supervisor and its subtree of runtime connection processes.
@spec stop_connection(GenServer.server()) :: :ok | {:error, term()}
Stop a running connection runtime.
@spec store(GenServer.server()) :: pid() | nil
Return the connection store pid when present.
@spec subscribe(GenServer.server(), (map() -> term())) :: (-> :ok) | {:error, :event_emitter_not_available}
Subscribe to raw event maps emitted by the connection runtime.
@spec which_children(GenServer.server()) :: [ {term(), :restarting | :undefined | pid(), :supervisor | :worker, :dynamic | [module()]} ]
Safely returns the child specifications for the active connection supervisor subtree.