Skip to main content

Module channel

Module channel 

Source
Expand description

The agent’s end of the runner channel: length-prefixed JSON and the handshake.

Each message is a 4-byte big-endian length followed by that many bytes of UTF-8 JSON (see schedr-model, runner). Generic over any byte stream, so it is tested in memory.

Structs§

Messages
A stream read a message at a time, safe to cancel: a message read in part when its read is dropped (a select! another branch won) waits here for its rest, where read_message would lose it and read the rest as a new message (B57).

Enums§

ChannelError
Why a message couldn’t be exchanged with the runner.

Functions§

accept_runner
Accepts a newly connected runner: reads its hello, refuses a version mismatch, and welcomes it otherwise.
read_message
Receives one message.
write_message
Sends one message.