-
Notifications
You must be signed in to change notification settings - Fork 71
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
Convert to Async #22
Convert to Async #22
Conversation
It's a bit of a shitshow because of lifetimes, and the fact that async functions can't be used as function pointers (because the return value is not sized predictably in a dynamic context). This thread was really hepful to me: https://users.rust-lang.org/t/how-to-store-async-function-pointer/38343/4 All that's left to do is: * Fix the doctests * Actually try out the examples and see if they are still working/performant. * Go hunting for places where explicit threads are used which could be turned into tasks.
@alsuren I've added a simple macro to remove the code-duplication required to wrap each task. I couldn't figure out how to put While it's not perfect, as it gives a 2x boost in performance I think this is usable/mergable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good to merge - only nits remain
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clarified comment
Re-implement async support without using
macro_rules_attribute
With help from this thread:
https://www.reddit.com/r/rust/comments/goh2be/how_to_store_an_async_future_to_a_function_with_a/