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

Better operation cleanup #26

Open
obmarg opened this issue May 30, 2021 · 2 comments
Open

Better operation cleanup #26

obmarg opened this issue May 30, 2021 · 2 comments

Comments

@obmarg
Copy link
Owner

obmarg commented May 30, 2021

#23 (and it's predecessor #19) added a stop_operation function that can be called to send a Complete message when a subscription is done. There's some improvements that could be made though:

  1. Stopped operations will still be in the operation map. Should figure out a way to remove them.
  2. If you drop a StreamingOperation it'll never be stopped. Ideally need a way to run stop_operation on drop (currently it's an async operation which makes this tricky - might need a way to do this that doesn't rely on async/await
  3. Not quite related, but I'm noting it down here anyway: if the server stopped the subscription we ideally need a way to tell how & why on the StreamingOperation itself.
@Sytten
Copy link
Collaborator

Sytten commented Jun 22, 2022

I think we could also switch from using async mutex to parking_lot mutex since we don't keep the lock across await.
This means there is no need for and async mutex and it's much slower than a sync mutex.

@obmarg
Copy link
Owner Author

obmarg commented Jun 28, 2022

Yeah, up for that if you think it makes sense @Sytten

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

2 participants