-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Evaluate fine-grained-ness of feature flags (to enable components individually) #1709
Comments
The goal is to be able to opt-in / out of components with the same level of granularity as was possible w/ separate crates. Work on this will probably start after the You are correct that I don't think that the Could you expand on how you are using |
I'm writing async_executors to have traits like That being said, if the traits from the futures lib are good for everyone, then the tokio traits could be removed. I would be in favor of having only one set of traits. It would also be possible to just implement the futures traits in each executor library rather than making a wrapper. I just felt progress would be faster by wrapping since async-std doesn't provide the traits either, nor juliex and who knows for future executor implementations. I feel getting to an ecosystem wide consensus on such things is always long term work. Since executing requires a Another question is the error handling. Currently the Spawn traits from futures return a futures specific error which has only a |
ps: there is currently no trait that specifies the possiblity to spawn getting a |
Thanks for the feedback. As you pointed out there are. I traits that support join handles and there is no “zero cost” trait... except TypedExecutor which got minimal use. Given this, my current plan is to just delete Tokio’s executor traits for the time being. |
This has been done (feature flags re-evaluated). Separately, executor types are removed. |
This is a follow up from the discussion in #1702. The different sub-crates are being merged into one tokio crate. To avoid code bloat, the idea is to let users only enable features they need with cargo feature flags.
Currently the merging of crates has reduced a few options, and some of the features can be reviewed. From what I can tell for tokio-executor (which is what I was using most) we can enable gradual inclusion as:
Maybe it can be extended to the runtime:
In that case the distinction between executor and runtime is maybe not so relevant anymore?
On a sidenote, I might mention that tokio seems geared more towards a global spawn function approach (enter execution context and then use
tokio::spawn
). From a poll I did this summer, it would seem most people are more in favor of an approach where libraries take a generic executor with aE: Spawn
trait bound.I have been trying to work out for a while now a way to create a convenient way for libraries to spawn futures, while leaving it up to application code to choose which executor to use. I am settling on enabling 3 different models:
Spawn
andLocalSpawn
traits from futures-rs and probably will addExecutor
andTypedExecutor
from tokio.Hence the interest for being able to build from components instead of an entire framework. It is harder to make something like this work with the need to combine reactor with executor, but if reactor and timer are conditional, it's still possible to provide wrappers around the runtime and let the end user enable the reactor feature if they need it.
The text was updated successfully, but these errors were encountered: