-
Notifications
You must be signed in to change notification settings - Fork 2
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
Question: any way to make it runtime agnostic? #2
Comments
Hi @augustocdias , I totally agree with your point, dependency from any concrete runtime is definitely a weak point unless such runtime was blessed by a Rust core team. But I don't think such one exists. As you might noticed, so far the whole implementation is based on async-std, but after your question I think I'd like to invest if it's something I could implement. If you know about such attempts made by others I'd really appreciate any link or a contact point. As for the plans in regards of maintenance, I didn't decide yet. I've just got the async version working literally this weekend. I'll be trying to maintain both with maybe a bigger focus on cdrs-async to make it more stable and possibly providing some of missing features. However, taking into consideration the fact that I'm the only one active and regular contributor to the sync version it may happen that one day I'll need to merge them or to archive some. |
I'm not very experienced with it either, but a way I believe this could be accomplished is creating abstract traits for everything that demands the runtime. You could have have default structs implementing this traits for either runtime or multiple if you want. And a way to let the user use another runtime is creating constructors passing generic types of this trait in the entrypoints of the library. For example: |
@augustocdias 👍 |
Let me know if I can help with something. With this quarantine I’m having some free time. |
Also maybe take a look into this crate https://github.com/bastion-rs/agnostik It claims to facilitate the job to make executor agnostic libraries. |
@augustocdias Sorry for the delay. You can try to progress with the whole issue if you have time and is still interested in that. |
I'll try... I've pulled the code and setup the basic changes in the |
I see a lot of libraries starting to move to async/await, but being dependent on specific runtimes (either async-std or tokio) and this can become a mess when developers starts to need different libraries depending on different runtimes...
Also are you planning to merge it with the synchronous version or maintaining both in parallel?
The text was updated successfully, but these errors were encountered: