Skip to content
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

Upstream flag in connect doesn't seem to work #56

Closed
dm3 opened this issue Dec 10, 2015 · 2 comments
Closed

Upstream flag in connect doesn't seem to work #56

dm3 opened this issue Dec 10, 2015 · 2 comments

Comments

@dm3
Copy link
Contributor

dm3 commented Dec 10, 2015

Given the following:

(deftest test-connect-filter
  (let [s1 (s/stream)
        s2 (s/stream)]
    (s/connect s1 s2 {:upstream? true})
    (s/close! s2)
    (is (s/closed? s2))
    (is (s/closed? s1)))

the test fails as s1 is still open.

According to the documentation of connect I would expect both s1 and s2 to be closed after closing s2, even without specifying the upstream? flag as s2 is the only downstream sink. However, even when :upstream? is true, s1 stays open.

Could you please take a look if is either a gross misunderstanding on my side or a bug?

@dm3 dm3 changed the title :upstream? true in `connect doesn't seem to work Upstream flag in connect doesn't seem to work Dec 10, 2015
@ztellman
Copy link
Collaborator

The upstream closing behavior isn't immediate, it will only take effect when s1 tries to convey a message to s2 and fails because it's closed. I'l think about how to make the documentation clearer on this point.

I'm going to close this issue, but feel free to ask any further questions you have.

@dm3
Copy link
Contributor Author

dm3 commented Dec 11, 2015

Thank you! Would be great if you could add that to the docs.

Also would be great if you could elaborate how the drained/closed states differ, maybe with some examples in the docs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants