flutter_rust_bridge icon indicating copy to clipboard operation
flutter_rust_bridge copied to clipboard

StreamSink impl async fn cancelled()

Open modeckrus opened this issue 1 year ago • 2 comments

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 avatar Oct 05 '24 19:10 modeckrus

Hi! Thanks for opening your first issue here! :smile:

welcome[bot] avatar Oct 05 '24 19:10 welcome[bot]

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 avatar Oct 05 '24 23:10 fzyzcjy

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Dec 06 '24 03:12 stale[bot]

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.

github-actions[bot] avatar Dec 27 '24 05:12 github-actions[bot]