Open danielcompton opened 8 years ago
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:
[ [ [row 1] [row 2] [row 3] ] [ [row 4] [row 5] [row 6] ] ]
In the future:
[ [row 1] [row 2] [row 3] [row 4] [row 5] [row 6] ]
You can use (core.async/into ch [])
which returns a go block with the contents of chan in the vector, which I think is what you're after.
The failing tests that I've implemented demonstrate the behaviour I'm looking for.
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?