Discussion
Loading...

Post

  • About
  • Code of conduct
  • Privacy
  • Users
  • Instances
  • About Bonfire
Cetra
@cetra3@mastodon.social  ·  activity timestamp 3 weeks ago

I learnt two things today about #rust and #tokio :

- `spawn_blocking` never gets cancelled, it will continue to run and finish your closure, even if the task waiting for the result is cancelled/dropped

- a `JoinHandle` will silently drop values without letting you know about them if that handle is dropped. Especially if the async task calling that method is cancelled/dropped

I discovered this by creating a wrapper which impl'd drop and printed out a log when the value was dropped

  • Copy link
  • Flag this post
  • Block
Log in

bonfire.cafe

A space for Bonfire maintainers and contributors to communicate

bonfire.cafe: About · Code of conduct · Privacy · Users · Instances
Bonfire social · 1.0.0 no JS en
Automatic federation enabled
  • Explore
  • About
  • Members
  • Code of Conduct
Home
Login