Sprites.ControlConn (Sprites v0.1.0)
View SourceA persistent WebSocket connection to a sprite's control endpoint.
Multiplexes exec operations over a single connection at /v1/sprites/{name}/control.
Each connection handles one operation at a time — the pool manages concurrency.
Messages sent to the owner process during an active operation:
{:control_data, :binary, data}— binary frame (stdout/stderr/exit in protocol encoding){:control_data, :text, text}— text frame (JSON messages like port, resize){:control_op_complete, exit_code}— operation completed{:control_op_error, message}— operation errored
Summary
Functions
Returns a specification to start this module under a supervisor.
Closes the control connection.
Releases the connection, clearing the current owner.
Sends binary data (stdin) through the control connection.
Sends a text frame through the control connection.
Starts a control connection (unlinked) to the given sprite.
Starts a control connection to the given sprite.
Starts an operation on this control connection.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec close(pid()) :: :ok
Closes the control connection.
@spec release(pid()) :: :ok
Releases the connection, clearing the current owner.
Sends binary data (stdin) through the control connection.
Sends a text frame through the control connection.
@spec start(keyword()) :: GenServer.on_start()
Starts a control connection (unlinked) to the given sprite.
Returns {:error, {:control_not_supported, status}} if the server returns 404.
@spec start_link(keyword()) :: GenServer.on_start()
Starts a control connection to the given sprite.
Returns {:error, {:control_not_supported, status}} if the server returns 404.
Starts an operation on this control connection.
Sends an op.start control message. The owner process will receive
data frames and completion messages.