Skip to content

Commit

Permalink
have concat close the streams, not just the stream-of-streams, fixes #82
Browse files Browse the repository at this point in the history
  • Loading branch information
Zach Tellman committed May 27, 2016
1 parent 71ba8cb commit f6fe13e
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/manifold/stream.clj
Original file line number Diff line number Diff line change
Expand Up @@ -795,10 +795,16 @@
(d/loop []
(d/chain' (take! in ::none)
(fn [s']
(if (identical? ::none s')
(cond
(closed? out)
(close! s')

(identical? ::none s')
(do
(close! out)
s')

:else
(d/loop []
(d/chain' (take! s' ::none)
(fn [msg]
Expand All @@ -807,7 +813,7 @@
(put! out msg)))
(fn [result]
(case result
false (close! in)
false (do (close! s') (close! in))
::none nil
(d/recur)))))))
(fn [result]
Expand Down

0 comments on commit f6fe13e

Please sign in to comment.