Open danielcompton opened 8 years ago
I forgot to add this :cry:
Will fix soon. It's going to be closed when calling core.async/close!
Great, was thinking that would be a good way to do it.
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.
Do you mean that currently calling async/close!
on a channel returned from clj-rethinkdb
doesn't close the changefeed?
Yes. The only way to close a changefeed is to close the connection.
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.
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 :smile:
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.
@apa512 Any movement on this? It requires pretty significant architectural workarounds for those of us managing lots of different changefeeds.
I'm pretty sure this works in 1.0.0-SNAPSHOT
. Let me get back to you with the specifics.
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?