Skip to content
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

Support volatile subscriptions #9

Closed
koivunej opened this issue May 19, 2017 · 1 comment
Closed

Support volatile subscriptions #9

koivunej opened this issue May 19, 2017 · 1 comment

Comments

@koivunej
Copy link
Owner

koivunej commented May 19, 2017

Making this issue to document what I've learned on subscriptions share my current thoughts on how to possibly proceed.

As I mentioned in another thread, the sequence of messages seems to be:

C: request_id: 1, payload: "subscribe to Foo"
S: request_id: 1, payload: "subscription started"
...
S: request_id: 1, payload: "notification on Foo"
... until either
C: request_id: 1, payload: "stop subscription"
S: request_id: 1, payload: "stopped because you unsubscribed"
...or...
S: request_id: 1, payload: "stopped because $reason"

Using tokio_proto::streaming::multiplex would almost allow supporting the whole conversation with notifications and "stopped because $reason" being the body chunks. However client sending "stop subscription" would have to somehow bypass the multiplex layer altogether, which I do not think is possible.

Other way would be to write a custom, more general multiplex support that would effectively create separate (Sink, Stream) pair for each request_id. As noted in the linked tokio_proto issue discussion, there might be more usage for such implementation than just the ES protocol.

Other thing the custom "more general multiplex support" could support is server sending something which is not in response to anything client requested. With ES these would be the heartbeat messages sent by server.

@koivunej
Copy link
Owner Author

This was never solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant