(rontolisp) docs
← Functions

rontolisp:stream-write

(rontolisp:stream-write stream chunk)

Appends chunk (which must not be nil) to an asynchronous stream and returns a future that settles when the stream accepted it, so a producer can flow-control by rontolisp:awaiting each write.

Writing to a stream whose write end was closed with rontolisp:stream-close signals an error:

> (let ((s (rontolisp:make-stream)))
    (rontolisp:stream-close s)
    (rontolisp:stream-write s "x"))
stream-write: the stream is closed

Backend support

Guest-created streams (rontolisp:make-stream / rontolisp:stream-write) exist on the interpreter and the JVM backend today; the WASM backends reject them at compile time (a --component program's streams come from rontolisp:fetch / rontolisp:http-handler bodies).