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

Closing an async changefeed #160

Open
danielcompton opened this issue May 13, 2016 · 10 comments
Open

Closing an async changefeed #160

danielcompton opened this issue May 13, 2016 · 10 comments

Comments

@danielcompton
Copy link
Collaborator

I'm looking at the new async code, and I'm not quite sure how to close a changefeed once I'm done with it. @apa512 do you have any ideas?

@apa512
Copy link
Owner

apa512 commented May 14, 2016

I forgot to add this 😢

Will fix soon. It's going to be closed when calling core.async/close!

@danielcompton
Copy link
Collaborator Author

Great, was thinking that would be a good way to do it.

@apa512
Copy link
Owner

apa512 commented May 16, 2016

I'm not sure how to best communicate to the client that a channel has closed. Would it be enough to check if the channel is open when receiving a partial success, and close the feed if it's not?

This would leave the feed open if a change never happens after the channel is closed.

@jwr
Copy link
Contributor

jwr commented Jun 14, 2016

Do you mean that currently calling async/close! on a channel returned from clj-rethinkdb doesn't close the changefeed?

@apa512
Copy link
Owner

apa512 commented Jun 14, 2016

Yes. The only way to close a changefeed is to close the connection.

@jwr
Copy link
Contributor

jwr commented Jun 14, 2016

Thanks. Very glad I caught this. This means I can't deploy into production what I've built, where new changefeeds are opened (and closed) regularly.

@arichiardi
Copy link
Contributor

arichiardi commented Jul 4, 2016

Is there an example of a changefeed? I'd like to start using that with a core.async channel hooked with websocket. I know I know lazy programmer here, but I can add it to the README 😄

@jwr
Copy link
Contributor

jwr commented Dec 18, 2016

For anybody else who happens to end up here — the workaround is to maintain a separate connection for each changefeed, which you disconnect when the changefeed is no longer needed. This should work until you need lots of changefeeds.

@venantius
Copy link
Contributor

@apa512 Any movement on this? It requires pretty significant architectural workarounds for those of us managing lots of different changefeeds.

@apa512
Copy link
Owner

apa512 commented Apr 3, 2017

I'm pretty sure this works in 1.0.0-SNAPSHOT. Let me get back to you with the specifics.

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

5 participants