-
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
Make success sequence return each result as an element in the stream #161
base: master
Are you sure you want to change the base?
Conversation
Just to make sure I understand: do you mean that async operations (except for changefeeds) return a cursor (which can be used like a lazy seq) on the channel as opposed to one item at a time? I considered the second option but decided against it because I couldn't find a convenient way to get all items from the channel, which is usually what I want. |
Currently, if you get a stream back (either success sequence, or success partial), all of the rows in the stream are put as one 'item' on the core.async channel. I'm suggesting that each row is put on as a separate item on the channel. Currently:
In the future:
You can use The failing tests that I've implemented demonstrate the behaviour I'm looking for. |
ac2cd38
to
1c4544f
Compare
They are the same function, but decode-stream is the 'master', and decode-channel has been def'd to equal decode-stream.
In an async query, success sequence and success partial rows are put on the channel row by row. This means that the consumer can be unaware of the batching that takes place between the driver and RethinkDB.
1c4544f
to
fa7b16c
Compare
Are you still working on this?/Can I help in some way? The new behaviour would be immensely helpful for code that does not need to distinguish between changefeeds and sequences. |
I plan to implement this but I'm not sure how soon. Probably in a week or two. |
Great, thank you very much! |
I also hope to get to it in a week or so :) |
In the official RethinkDB drivers, success sequence's return a single row in each element. This is a fairly natural model, and hides the fact that some results are returned in chunks. Currently, success sequence results are put onto the core.async channel as a single value. Would you be open to changing the model to match how the official drivers do it?