The main question is then: what should async libraries do if they need to spawn futures or use types like TcpStream? The answer is that they shouldn't. And in most cases they really don't need to... 5/15
-
-
Sorry for bothering, newbie rust learner here, would something like this helps? Just found out this crate the other day. https://github.com/najamelan/async_executors … Which seems aiming to solve part of the problem.
-
I think that approach encourages hyper's philosophy, but gets around the problem by abstracting over all currently available runtimes. In a way, "async_executors" is a spiritual successor to "runtime".
- 2 more replies
New conversation -
-
-
Are AsyncRead/AsyncWrite being standardized? Is it the version as defined in futures-rs?
- End of conversation
New conversation -
-
-
What if not spawning would lead to blocking? That seems like a footgun to expose to the consumer of the API.
-
I don't have a very good answer, but at that point I wonder whether that async library is worth being async at all. In other words, how much of an improvement is it to the user over simply calling a synchronous library inside spawn_blocking()?
- 1 more reply
New conversation -
-
-
Is it fair to conceptualize this approach as being vaguely similar to dependency injection? What about a Spawner trait?
-
Yes, that's a good way of looking at it. The Spawner trait is a good idea that has never caught on and is apparently less useful than we thought it would be (in my understanding).
- 1 more reply
New conversation -
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.