logoalt Hacker News

Ygg2yesterday at 7:15 PM1 replyview on HN

> It degrades API surfaces to the worst case :Send+Sync+'static because APIs have to be prepared to run on multithreaded executors

This isn't true at all. The Send+Sync+'static is basically the limitation of tokio::spawn

https://emschwartz.me/async-rust-can-be-a-pleasure-to-work-w...

Change the executor, and the bound changes.


Replies

iknowstuffyesterday at 9:38 PM

I think they mean tokio::spawn’s signature forces libraries that want to be easy to use with it to expose send+sync APIs (and thus use Arc+Mutex internally)

show 1 reply