🟨 Concurrently read and write a byte stream staying inside fixed buffers
Async Streams read and write data concurrently from async sources to destinations.
Read and writes happen in parallel if sources and destinations are asynchronous. This library does not allocate any memory, all buffers are supplied by the caller.
Async Streams support reading from an async source and placing such reads in a request queue. This queue is bounded, so it will pause the stream when it becomes full. Data is pushed downstream to listeners of data events. Such listeners can be for example writers and they will eventually emit a drain
event that resumes the readable streams that may have been paused.
Async Stream | Description |
---|---|
AsyncReadableStream | Async source abstraction emitting data events in caller provided byte buffers. |
AsyncWritableStream | Async destination abstraction where bytes can be written to. |
AsyncPipeline | Pipes reads on SC::AsyncReadableStream to SC::AsyncWritableStream. |
Async streams is heavily inspired by Node.js streams but drops a few features to concentrate on the most useful abstraction.
Async streams do not allocate any memory, but use caller provided buffers for handling data and request queues.
🟩 Usable features:
🟦 Complete Features:
💡 Unplanned Features: