Great! Been doing blocking I/O inside tokio so might switch to this... but is blocking practically a problem when you just block one task and your runtime has several threads?
-
-
-
It's still a problem because other threads will not steal tasks from the blocked thread until they run out of work. In theory, that might never happen.
End of conversation
New conversation -
-
-
the impl<T> Future for Blocking<T> {type Output = T;} does not make sense to me. It doesn't align well with the symantics of Future or with the stated goal of the project. impl<T,U> Future for Blocking<T> where T:Deref<FnOnce()->U>{type Output = U;} makes much more sense to me.
-
Hey, thanks for the feedback! I discussed this with folks in the smol Discord and decided to change the interface as you suggested (except for the `Deref` part). How does this look now? :) https://docs.rs/blocking/0.3.0/blocking/ …
- 1 more reply
New conversation -
-
-
How can we think about naming here? I'm looking for a name that makes the code more intuitive, maybe. Right now we have `Blocking::new` which creates a new operation... that's not blocking. It's as if `Unblocking::new` would be a better name? ;) except maybe not exactly that
-
There were a lot of suggestions here: https://github.com/stjepang/smol/issues/79 … None of the suggested names felt perfect - Blocking<T> was the most obvious one, even though it doesn't make too much sense, but somehow everyone understood what it does at a glance. Or, it was the least hated one :)
- 3 more replies
New conversation -
-
-
nice to see you're separating things out from smol to keep it small :)
-
oh and i seem to have started the wasm32 backend for smol...
End of conversation
New conversation -
-
-
That looks great! :D
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
Thank you for the amazing work!
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.