-
Notifications
You must be signed in to change notification settings - Fork 42
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
Core async channel API #55
Conversation
544fe4a puts any error messages from RethinkDB on an error-chan. |
2ea2709
to
050701b
Compare
Should we open an issue to discuss manifold vs core.async? |
The only changes between v4 and v3 are its behaviour around sending multiple queries at the same time. Before the first one would need to return before any further queries would be returned, e.g. a stack. With v4 it returns whenever a query is done, and the driver needs to disambiguate (as we do already). The other change is that on v3 a changefeed query would return after 500ms even if there were no changes to allow other queries to be executed (to avoid blocking the head of line). Now queries are held open permanently and don't return until there are changefeeds to report. This breaks the Cursor abstraction that we use. Theres a few options here:
|
016ef5a
to
83037bf
Compare
d220bc3
to
5210efc
Compare
Is there any news on this PR? I have been working on an application with a non-blocking back-end that frequently uses core.async, and I would like to incorporate change feeds in a consistent manner. If you need a hand getting this into master I may be able to help depending on my workload. |
@KeeganMyers I'm still working on this, GitHub's UI makes it look like I haven't done anything since June, but I'm chipping away at it if you look at commit times :) I'm currently using a SNAPSHOT for this, and you could too if you wanted to get this ahead of time (though I'd strongly recommend pinning to a specific SNAPSHOT version). As far as offers for help, that's really appreciated, and as I get closer to firming up the API that would be really helpful. Thanks! |
1764989
to
7567e4d
Compare
* Rename connection channels * Create add-to-waiting and remove-from-waiting functions for waiting queries * Move some replace-vars to query-builder, * Create prepare-query function to consolidate query-prep functions
Successful result, and error handling
- Revert back to onto-chan for type 1 and 2 results - Add channel set to waiting connections to be used when shutting down
7567e4d
to
d60ed79
Compare
Update tests to run against both query types Make query response shapes more similar to standard driver
Relates to #97
Revert removing the (Thread/sleep 250) from cursors. I don't quite understand it's purpose yet, but it is obviously needed.
This PR is subsumed by the more recent manifold work. Closing as I'll do future async work on the mainline branch. |
I deleted my fork of the clj-rethinkdb repo and didn't realise I still had
async-chan
on it. Reopening the PR from #37 here.This PR adds support for a core.async channel API. It also rearranges a few things to make them tidier and easier to use from two different run functions. Of particular note, this upgrades protocol support to v4. This gives us the benefit of "long-polling" the TCP socket when we are
:CONTINUE
ing, rather than having to keep sending queries every 500ms. More detail about this is at rethinkdb/rethinkdb#4400 (comment)This PR isn't finished yet, in particular it needs
:error-channel
and:control-channel
too?run-query-chan
to therethinkdb.query
namespace or adding a helper function:CONTINUE
queries and we don't want to do this more than once. Alternatively I can imagine that there could be an async API which the other two layer on top of, but I'm not sure how it would actually work with:CONTINUE
queries.23:58:57.882 TRACE rethinkdb.net - Received raw response %s [0 ]
. This is because it's trying toread
on the socket. This is likely a pre-existing condition, but need to check it out further.