AssetStream
- Type parameters:
T
A pull stream of decoded messages or chunks, with one pending read at a time.
Constructor
function new(driver:AssetStreamDriver, decode:(Bytes) -> T)Methods
function map(convert:(T) -> U):AssetStream<U>Mapped views share the same connection; closing one closes them all.
function next():Future<StreamItem<T>>function listen(onItem:(T) -> Void, ?onEnd:() -> Void, ?onError:(Exception) -> Void):() -> VoidContinuously pulls after each synchronous handler returns; returns a cancellation function.
function close():VoidCancels pending reads; listeners finish normally on an explicit close.