Streams
Capy comes with an API for byte transport in the form of streams. Any concrete transport mechanism is expected to use this API in order to interoperate with Capy-based programs. While such concrete mechanisms — like 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,
-
type-erased wrappers for streams.