Holds the routed-host WebSocket clients for one Bourse.WS connection.
Owners start under Bourse.WS.ConnectionOwner.Supervisor (:temporary) and
are linked to the process that opened the Bourse.WS connection. Stopping or
crashing an owner closes every socket it still holds, so a dead owner cannot
leave an unreachable routed host, and an owner whose process dies is visible
to its dependents.
Summary
Functions
Returns the client for url, connecting through connect_fun when it is new.
Returns a specification to start this module under a supervisor.
Starts a supervised owner holding zen_client at url.
Stops the owner. Remaining clients are closed from terminate/2.
Removes and returns every held client so the caller can close them.
Functions
@spec checkout( pid(), (String.t(), keyword() -> {:ok, ZenWebsocket.Client.t()} | {:error, term()}), String.t(), keyword(), timeout() ) :: {:ok, ZenWebsocket.Client.t()} | {:error, term()}
Returns the client for url, connecting through connect_fun when it is new.
@spec child_spec({String.t(), ZenWebsocket.Client.t()}) :: Supervisor.child_spec()
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec start(String.t(), ZenWebsocket.Client.t()) :: {:ok, pid()} | {:error, term()}
Starts a supervised owner holding zen_client at url.
Stops the owner. Remaining clients are closed from terminate/2.
@spec take(pid(), timeout()) :: {:ok, [ZenWebsocket.Client.t()]} | {:error, term()}
Removes and returns every held client so the caller can close them.