-
Notifications
You must be signed in to change notification settings - Fork 113
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
Async/await support? #167
Comments
Could you say more about why you think this library should support that? What exactly would that entail? |
@BurntSushi I do not know about the internals of that library so I would not know. It seems that the macro creates a block of code that is synchronous and |
Hi @Leo-LB 👋 I don't think it's feasible for async fn make_i32() -> i32 {
41
}
lazy_static! {
static ref FUT: Box<dyn Future<Output = i32> + Sync> = Box::new(async {
let r = make_i32().await;
r + 1
});
} You can't do much with that future because you can't get mutable access to it without some additional synchronization, and futures tend to be poisoned after producing their result the first time. At this stage, I think this is out-of-scope for So I think the best way forward here would be either fork |
like this? |
Currently it's not possible to do:
The text was updated successfully, but these errors were encountered: