-
Notifications
You must be signed in to change notification settings - Fork 633
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
Move spawn, spawn_with_handle into futures-util as macros #1140
Comments
Yeah, that sounds good! I'd also +1 |
I also favor the macro versions and would like to replace these with macro versions. However, @Nemo157 mentioned this use case once: let handle = await!(spawn_with_handle(future).with_executor(...)); How could this work with macros? |
You could always fall back to using |
The documentation on spawn says that the function |
@aajtodd You're right. It should say "the context's executor" |
@cramertj How about providing only macros, but with an optional spawn!(future);
spawn!(future, executor); |
@MajorBreakfast if you have an executor and a future, you don't need a macro-- you can write |
@cramertj You're right, the macro isn't needed for this use case. I've created an issue for |
I had the same initial reaction, eventually I figured out that "the default executor" is "the current context's executor", there's nothing else for it to refer to. 👍 for clarifying this a bit more. |
Closed by #1156 |
These are currently in
futures-executor/src/spawn.rs
but they don't depend on anything from thefutures-executor
crate => they should live infutures-util
because they're general purpose and similar to the kind of stuff infutures-util
The text was updated successfully, but these errors were encountered: