low-level transport - covers put!ing onto and take!ing from a stream, error propagation, special value wrapping/unwrapping and stream connection
low-level transport - covers put!ing onto and take!ing from a stream, error propagation, special value wrapping/unwrapping and stream connection
(closed? s)
not in the public API, because it's so often a race condition, but may be sometimes useful for inspection
not in the public API, because it's so often a race condition, but may be sometimes useful for inspection
(connect-via source f sink)
(connect-via source f sink opts)
feed all messages from src into callback on the understanding that they will eventually propagate into dst
the return value of callback should be a boolean or promise yielding a boolean. when false the downstream sink is assumed to be closed and the connection is severed
feed all messages from src into callback on the understanding that they will eventually propagate into dst the return value of callback should be a boolean or promise yielding a boolean. when false the downstream sink is assumed to be closed and the connection is severed
(error! sink err)
mark a stream as errored
puts an marker wrapper with the error on to the stream, and then closes it. consuming fns will throw an error when they encounter it, so errors are always propagated
it would be nicer if the underlying stream/channel had an error state, but this is the best to be done without wrapping the underlying stream/channel
mark a stream as errored puts an marker wrapper with the error on to the stream, and then closes it. consuming fns will throw an error when they encounter it, so errors are always propagated it would be nicer if the underlying stream/channel had an error state, but this is the best to be done without wrapping the underlying stream/channel
(put! sink val)
(put! sink val timeout timeout-val)
put a value onto a stream with backpressure - returns Promise<true|false> which eventually resolves to:
put a value onto a stream with backpressure - returns Promise<true|false> which eventually resolves to: - true when the value was accepted onto the stream - false if the stream was closed - timeout-val if the put! timed out
(put-all! sink vals)
put all values onto a stream with backpressure returns Promise<true|false> yielding true if all values were accepted onto the stream, false otherwise
put all values onto a stream with backpressure returns Promise<true|false> yielding true if all values were accepted onto the stream, false otherwise
(safe-connect-via-fn f sink)
return a new connect-via fn which handles errors in the connect fn or from the source and error!s the sink
return a new connect-via fn which handles errors in the connect fn or from the source and error!s the sink
(stream)
(stream buffer)
(stream buffer xform)
(stream buffer xform executor)
(stream)
(stream buffer)
(stream buffer xform)
(take! source)
(take! source default-val)
(take! source default-val timeout timeout-val)
take a value from a stream - returns Promise<value|error> which evantually resolves to:
NOTE take! API would ideally not return chunks, but it curently does... don't currently have a good way of using a consumer/ChunkConsumer in the public API, since i don't really want to wrap the underlying stream or channel in something else
take a value from a stream - returns Promise<value|error> which evantually resolves to: - a value when one becomes available - nil or default-val if the stream closes - timeout-val if no value becomes available in timeout ms - an error if the stream errored (i.e. an error occurred during some upstream operation) NOTE take! API would ideally not return chunks, but it curently does... don't currently have a good way of using a consumer/ChunkConsumer in the public API, since i don't really want to wrap the underlying stream or channel in something else
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close