Opsmaru.Incus.DynamicConsole (opsmaru_incus v0.1.0)

Copy Markdown View Source

Native dynamic console: one accepted operation/control channel and repeated explicit data attachments. Attachments, handshake time and total lifetime are bounded. The creating process owns the console; its exit or explicit close releases local channels, sending the pinned 1000 "Detaching from console" close frame on the control channel, without cancelling the backend operation. A failed attachment retains the operation and never repeats the console POST.

attach/1 returns a native WebSocket byte channel. Hosts explicitly send/read binary frames through WebSocket, then detach/2; no terminal, IO device or platform callback is opened automatically. Control messages use native JSON. Asynchronous errors from recognized channels are forwarded as {:dynamic_console, console.pid, {channel.ref, :error, error}}, retaining the exact cause and accepted operation for reconciliation. Unknown channel references are ignored.

Summary

Functions

attach(console)

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

close(console)

control(console, body)

detach(console, channel)

open(client, instance, body, opts \\ [])

resize(console, width, height)