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

Return a specific type from streaming_operation. #7

Open
obmarg opened this issue Feb 14, 2021 · 1 comment
Open

Return a specific type from streaming_operation. #7

obmarg opened this issue Feb 14, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@obmarg
Copy link
Owner

obmarg commented Feb 14, 2021

AsyncWebsocketClient::streaming_operation currently returns an anonymous Stream type. This is fine for reading the results of a subscription, but there's a few things it can't support:

  1. Stopping the subscription (arguably dropping the stream might do this, although not sure if it's handled very cleanly).
  2. Checking why a stream ended.

Ideally we'd return a custom type that implements Stream but also:

  1. Provides a stop function.
  2. Stops the subscription cleanly on drop.
  3. Provides a way to check whether the subscription stopped "cleanly" or because of some sort of connectivity error etc.
@obmarg obmarg added the enhancement New feature or request label Feb 14, 2021
@obmarg
Copy link
Owner Author

obmarg commented Feb 14, 2021

There's a allow(dead_code) on the Message::Complete variant that can be removed once we have support for explicitly ending subscriptions.

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

No branches or pull requests

1 participant