krojew/cdrs-tokio

Why is stream_id moved out of Frame?

Closed this issue · 5 comments

rukai commented

Looking at the cassandra protocol spec and our current usage of frame.stream it makes a lot of sense for stream_id to be in Frame.
What was the reasoning behind moving it out of Frame?

The problem with having a stream id in a frame was that it's ignored for any writes, since the id needs to be generated at the moment of sending a frame (per connection), rather than constructing one. To be honest, this makes it hard to place - on one hand it is a part of a frame; on the other, it's totally ignored. From the point of view of your use cases, what is the best approach? Should we keep it where it was and ignore sometimes?

Come to think of it - since it is a part of the protocol spec, this should be brought back into the frame. Any high-level interface needs to deal with the problem of generating ids.

I moved the stream back - let me know if you find some other inconsistencies, form the protocol point of view.

rukai commented

Thanks, will do!

Is everything fine now, can this be closed? I think, given the lack of issues, it's time for a stable release soon.