Liking cljdoc? Tell your friends :D

prpr.stream.transport

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
raw docstring

close!clj/s

(close! s)
source

closed?clj/s

(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
sourceraw docstring

connect-viaclj/s

(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
sourceraw docstring

error!clj/s

(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
sourceraw docstring

put!clj/s

(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:

  • true when the value was accepted onto the stream
  • false if the stream was closed
  • timeout-val if the put! timed out
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
sourceraw docstring

put-all!clj/s

(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
sourceraw docstring

put-all-and-close!clj/s

(put-all-and-close! sink vals)
source

safe-connect-via-fnclj/s

(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
sourceraw docstring

streamclj/s≠

clj
(stream)
(stream buffer)
(stream buffer xform)
(stream buffer xform executor)
cljs
(stream)
(stream buffer)
(stream buffer xform)
source

stream-factoryclj/s

source

stream?clj/s

(stream? v)
source

take!clj/s

(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:

  • 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

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
sourceraw docstring

unwrap-platform-errorclj/s

(unwrap-platform-error x)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close