ReadableStream

A stream can be used by just one task at a time, but one task can consume multiple streams.

Streams may be populated by async sources (in which case they must be called from a fiber task), from a function generating the data on demand (including an input range), from memory, or from a synchronous file.

A stream of heterogeneous types is compatible with input ranges.

It reads binary data.

Members

Functions

feedData
void feedData(ubyte[] data)

Feeds data into the stream, which can be consumed by get. If a task is waiting for more data to satisfy its get requests, this will trigger those tasks to resume.

get
T get(ByteOrder byteOrder, string file, size_t line)
T get(size_t length, ByteOrder elementByteOrder, string file, size_t line)
T get(bool delegate(E e) isTerminatingSentinel, ByteOrder elementByteOrder, string file, size_t line)

Gets data of the specified type T off the stream. The byte order of the T on the stream must be specified unless it is irrelevant (e.g. single byte entries).

isClosed
bool isClosed()
waitForAdditionalData
void waitForAdditionalData()

You basically have to use this thing from a task

Meta