3 ms·
I don't think you'd have to pass the context into an await? Await is a Rust construct, not a tokio one. Unless I'm making a complete fool of myself... Maybe I'
by ahepp 4y ago
I don't think you'd have to pass the context into an await? Await is a Rust construct, not a tokio one. Unless I'm making a complete fool of myself...
Maybe I'm just jaded from writing too much C, but it doesn't seem like a big deal to me to change sleep(duration) to sleep(ctx, duration). Three letters to be correct, transparent, and not have global state? Look at what a complete mess the C standard library is from where they used global state like that.
I'm sure there are lots of other ways you could do it, like make the context it's own struct and call a sleep impl for the struct or something?
- davidatbu 4y agoYeah, I guess we're disagreeing about a very non-concrete proposal, so there isn't much point to our convo :)