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

StreamSink impl async fn cancelled() #2339

Open
modeckrus opened this issue Oct 5, 2024 · 2 comments
Open

StreamSink impl async fn cancelled() #2339

modeckrus opened this issue Oct 5, 2024 · 2 comments
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc enhancement New feature or request

Comments

@modeckrus
Copy link

I use spawn to send something in stream via StreamSink, and I want to close this green thread when dart stream is closed. So I suggest to add method for StreamSink cancelled like in https://docs.rs/tokio-util/latest/tokio_util/sync/struct.CancellationToken.html

@modeckrus modeckrus added the enhancement New feature or request label Oct 5, 2024
Copy link

welcome bot commented Oct 5, 2024

Hi! Thanks for opening your first issue here! 😄

@fzyzcjy
Copy link
Owner

fzyzcjy commented Oct 5, 2024

Looks reasonable and feel free to PR for this new feature! Alternatively I may work on it later.

As a workaround before it is implemented, you can explicitly call a Rust function marking it is closed when that happens.

@fzyzcjy fzyzcjy added the awaiting Waiting for responses, PR, further discussions, upstream release, etc label Oct 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting Waiting for responses, PR, further discussions, upstream release, etc enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants