clj-commons / manifold

A compatibility layer for event-driven abstractions
1.02k stars 106 forks source link

stream->seq without timeout on streams never returns #177

Closed minikomi closed 5 years ago

minikomi commented 5 years ago

I have a stream built up which I finally want to block on and consume as a sequence.

I tried using stream->seq but, without a timeout, it blocks indefinitely without returning:

(def st (s/stream))

(s/put-all! st (range 10))

(s/stream->seq st)

Compared to:

(def st (s/stream))

(s/put-all! st (range 10))

(s/stream->seq st 0)

which returns instantly.

Alternatively, is there a way to block and consume a stream until all values have passed through?