Skip to main content

serve

Function serve 

Source
pub fn serve<F>(path: &Path, sink: F) -> Result<Reader, String>
where F: FnMut(ChannelMessage) + Send + 'static,
Expand description

Bind path and hand every frame a host writes to sink.

The reader runs on its own thread and is stopped through the returned guard: the server keeps one per open profile, and a closed profile’s thread ends rather than waiting on an accept that will never return.

Each connection gets a reader of its own. A host opens one connection per tab, and accepting one stream at a time would leave every tab after the first waiting in the backlog with its frames never read.