-
Notifications
You must be signed in to change notification settings - Fork 31
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
Using await/async in middleware #131
Comments
Hi @armoona, First of all, I'm sorry for the late reply! Been busy lately and couldn't monitor Github as much as I wish in the past days. I believe your example code is mostly correct, I am planning to convert IO into a cancellable async context so you could skip the Task block yourself, similar to what is done in the That said, if you want to implement ad-hoc the same solution, I believe your code should work, and you may consider storing the task in the middleware for future cancellation. You can also consider making the API Please let me know if this works well, I am still rewriting the Middleware base class to accommodate all the changes I wish to do (such as better SPM dependency chain) and the async/await Middleware is not yet in development so I don't know all the challenges in implementing it yet. If you wanna contribute with the |
Any progress about this? |
Hi @wangpeiyan, I'm currently traveling and with no access to my Macbook. I'll return working on these topics somewhere in August, but before that I believe my comment should already point you to the right direction. If you open a PR with this new middleware, I'll be glad to approve it and release a version. It shouldn't be too hard, it only needs a good amount of unit tests. |
@luizmb thank you for your reply, i'm new of the redux concept and still leaning it。But i can clearly understand your comment, so i will try to implement a local version |
I am trying to use await/async in middleware. For example, rewriting the sample from the docs, is this correct?
The text was updated successfully, but these errors were encountered: