Open rylev opened 6 years ago
Do you think this would go in the Putting it Together section of "Futures, Streams, and Sinks"?
That could work. The only issue is that Futures and Streams will definitely be mentioned before that section (even in the hello-world guide). We'll need to figure out how to appropriately introduce them without confusing beginner readers or having to fully explain them so early.
What do you mean by futures from different libraries? All futures should run on any runtime. You shouldn't need to?
Maybe this is a question to be addressed though. Why did you think you would need a runtime per library?
@carllerche I was watching @jonhoo's latest stream and one of the project's he committed to was using a Futures thread pool inside of a hyper application. This seemed to be because the author of the crate didn't really understand how to compose some asynchronous work he needed to do in his application code with the already running tokio runtime used by hyper. I feel like this is a possible point of confusion for people. Perhaps I can rename the issue to something that more clearly conveys this point?
Is this related to https://github.com/bcmyers/argonautica/pull/7?
Perhaps this could go in the: "Tokio for libraries" section?
Ah, no, I think he's referring to https://github.com/graphql-rust/juniper/pull/256
Composing multiple libraries that use Futures but don't know about each other is probably a very common scenario. For instance, if I want to use hyper and the async API of redis-rs, how do I do that without spawning two runtimes?