-
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
Will it work well with async/await ecosystem? #14
Comments
Hi @TennyZhuang, this question comes up from time to time, so I will explain here my thinking around this topic. First of all, I would love to support async libraries in lunatic applications, but it's a bit of a complicated situation at the moment. Here are some of the current issues that make it very hard to support most async libraries in lunatic. 1. Async ecosystem splitThere are not many truly "general purpose" async libraries. Most async libraries are heavily bound to an executor. This comes from the fact that async is heavily platform dependent and requires cooperation between the operating system, the library and the chosen executor. Even libraries that claim to be "runtime agnostic", like SQLx aren't really. They only have support for all the different runtimes because someone added it. There are bunch of other async executors out there that don't work with SQLx. This is even worse for the new kind of We could expose an executor in lunatic, but someone is going to need to go through all the libraries and explicitly add support for it. This can't happen automatically. So, if the libraries already need to be changed for lunatic, why not just add support directly for it? Instead of creating another level of indirection and creating an executor inside of lunatic. It's true that the keywords 2. Different programming modelMost rust frameworks (including async) are built around a concurrency model based on threads. This kinda makes them a bad fit for lunatic. Lunatic requires you to design your application around small processes that don't share any memory. Even if we added support for them, it would feel a bit awkward. Because of this, lunatic favours smaller libraries that do one thing well and work with standard |
It seems that it’s unnecessary for a stackful coroutine implementation to mark a function as async, but async/await was standardized in rust and many libraries will build on top it. Is it compatible with lunatic?
The text was updated successfully, but these errors were encountered: