Skip to main content

Module session

Module session 

Source
Expand description

Session orchestrator: bridges a SerialDevice with the EventBus.

At v0.1 a Session runs a single task that multiplexes the serial device, the cancellation token, and the bus subscription via tokio::select!:

The single-task model gives the dispatch handlers exclusive &mut access to the device, which is required for the synchronous control operations (set_baud_rate, set_dtr, send_break, …). The tradeoff is that a long write momentarily delays reads — acceptable for an interactive serial terminal where writes are short and rare.

Later issues plug in mappers (Issue #8), logging, scripting, and so on as additional bus subscribers.

Structs§

Session
Owns a serial device and a bus, and runs the I/O + command loop.