Streams
Capy comes with an API for byte transport in the form of streams. Any concrete transport mechanism is expected to use this API to interoperate with Capy-based programs. Concrete mechanisms, such as IOCP or io_uring, are part of a separate library (Corosio). Capy defines the API.
The high-level idea is that data is read and written in chunks, and you keep awaiting individual chunk transport in a loop.
The streams API consists of
-
algorithms implementing loops on top of stream concepts:
read,write,read_at_least, andwrite_at_least, -
type-erased wrappers for streams.