-
Notifications
You must be signed in to change notification settings - Fork 626
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
Reorganize subcrates for futures 0.3 #1071
Comments
I believe the guideline is "things that will (hopefully) never change".
The I wouldn't be surprised if over time bits and pieces migrate over to
What about trait StaticExecutor<F: Future> {
fn spawn(&mut self, future: F) -> Result<(), SpawnError>;
} (static as compared with dynamic trait object for the current executor trait). I think there's a few different executor traits that should be played around with; there's no rush to push these traits into the core library until they have been explored well. The only reason the main I've only really been skimming the current implementation stuff, so I'm actually unsure why the
I've wondered in the past whether A more charitable way to describe this crate would be the Swiss Army Knife of An associated question is whether libraries should be recommended to import the |
@MajorBreakfast Thanks for bringing this up! @aturon and I had discussed some possible changes to organization as well. I basically agree with everything that @Nemo157 said-- for me, the separation is all about stability tracking.
|
@Nemo157 That's actually a pretty good guideline!
@Nemo157 Library authors should probably not use the facade crate. Otherwise the interoperability can't work. I think we should recommend this clearly.
I would like to clean out futures_core and only leave the essentials. This is what I suggest:
This leaves: The core reexports, |
Surprisingly it still does, as an example:
Even though Once we get the ability to distinguish between public and private dependencies then it's definitely better for libraries to depend on the subcrates, |
@Nemo157 This is great! Looking at this though I think that |
Here's the layout I propose:
Rationale:
Edit: Atomic waker is used by |
Some thoughts:
This seems unnecessary to me, since it would be versioned and used identically to
This is basically the current
I'm not sold on the name-move. TL;DR My preference is to keep things as they are for now, although I don't care too much about where things like |
I agree that keeping things the way they are seems fine. I don't see a compelling argument for the churn. |
The changes that we agreed on were implemented in #1078 The previously bloated The only thing that will be a problem when I think this issue can now be closed. I'll keep it open for one more day to see if there're any more comments and close it then if there are no objections. |
We should reevaluate which subcrates contain what parts of the futures crate. I think that we should move some things around prior to releasing an alpha to get some consistency.
futures_core
crate containsFuture
andStream
and alsoReadyFuture
,CoreFutureExt
,ContextExt
andAtomicWaker
, but the io traits andSink
have their own crates. I think we should establish guidelines that define what kind of things belong infutures_core
and discuss whetherfutures_core
should exist at all.executor
andtask
? I'd say yes, but I'm not 100% sure. In any case some stuff likeLocalExecutor
should be moved intotask
(as a trait). It's weird thatLocalExecutor
is a struct andExecutor
a trait. That's unlikeFutureObj
/LocalFutureObj
andWaker
/LocalWaker
where always both are a trait or a struct respectively.futures-util
crate feels like a kitchen sink. I've counted the lines of code in thesrc/
directories of each crate and the utils crate contains three quarters of the total code (76%).@Nemo157
@carllerche
@seanmonstar
@withoutboats
@aturon
@cramertj
The text was updated successfully, but these errors were encountered: