-
Notifications
You must be signed in to change notification settings - Fork 108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
manifold.stream/on-closed never called upstream #82
Comments
Or maybe this should be better phrased as a question: How can I ensure everything upstream is being closed? |
This is the result of an bug in |
To be clear, there is also the issue where |
I was planning on using the |
Thanks for the concat fix @ztellman. On the issue when (let [s1 (s/stream)
_ (s/on-closed s1 #(println "closed s1"))
out (s/map inc s1)]
(s/close! out)
[(s/put! s1 1) (s/put! s1 2)])
closed s1
=> [<< true >> << false >>] |
Manifold's map, filter, ... operators don't call the on-closed handler of the source immediately. Only when a value is put into it.
e.g.
If you put a value in s1 it does call on-closed
I'm not sure if this is an issue, but I have 2 questions here:
put!
returning<< true >>
?I came across this behaviour when investigating an issue I ran into with
concat
:Here, on-closed on the 2 sources is never called. Is this intended behaviour?
The use case is the following: watch a directory for new files by concat'ing a stream of currently existing files and a stream attached to a hawk watch. If the resulting stream gets closed, the hawk watch should be stopped (by registering it as a callback on on-closed for the hawk stream), but is never called.
The text was updated successfully, but these errors were encountered: