Skip to content
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

Allow other async runtimes such as async-std #26

Closed
A248 opened this issue Jan 13, 2022 · 9 comments · Fixed by #35
Closed

Allow other async runtimes such as async-std #26

A248 opened this issue Jan 13, 2022 · 9 comments · Fixed by #35
Labels
Complete The code review for this issue has been completed; and is now being finalized. Enhancement New feature or request Major This issue or PR contains major changes

Comments

@A248
Copy link

A248 commented Jan 13, 2022

I'd like to use this library myself, but with async-std rather than Tokio -- my existing code is written against async-std.

Could async-std be supported by a feature flag? I am willing to create a PR if necessary

@john-bv
Copy link
Member

john-bv commented Jan 14, 2022

If it can be done without changing the API or code clutter than sure.

@A248
Copy link
Author

A248 commented Jan 14, 2022

No, it can't be done without changing the API. The API directly links to tokio, hence why I suggested a feature flag.

I'm not sure what exactly would qualify as code clutter. It depends on how much reliance there is on tokio, and how much of that can be replaced by executor-agnostic async code.

Based on a search for tokio using Github's search feature, tokio is only used inside server.rs, which seems promising.

@A248
Copy link
Author

A248 commented Jan 14, 2022

To clarify: the API would change very little. Only the start method appears to be affected. Overall, there doesn't seem to be an undue reliance on tokio, which means it may be easy to add support for other runtimes.

@john-bv
Copy link
Member

john-bv commented Jan 14, 2022

The only things that would need to be modified are the tokio tasks inside server.rs with the start method.

@john-bv
Copy link
Member

john-bv commented Jan 14, 2022

To clarify: the API would change very little. Only the start method appears to be affected. Overall, there doesn't seem to be an undue reliance on tokio, which means it may be easy to add support for other runtimes.

Feel free to make a PR. However I'd like to mention the external API should remain relatively the same.

@john-bv
Copy link
Member

john-bv commented Jan 14, 2022

I can make a PR in a bit adding this if you don't want to, as it could be useful in the future.

@john-bv
Copy link
Member

john-bv commented Jan 18, 2022

I'll be including this in the "v2" (actually 1.x.x) rewrite, as it includes a lot of design improvements from master, I expect the rewrite to be done sometime this week.

@john-bv
Copy link
Member

john-bv commented Jan 27, 2022

Okay, now that everything to my knowledge is 100% working, I will get started on this issue 😄

@john-bv john-bv closed this as completed Oct 31, 2022
@john-bv john-bv reopened this Dec 12, 2022
@john-bv
Copy link
Member

john-bv commented Jan 9, 2023

@A248 This issue is now tracking branch v3-async-std

@john-bv john-bv added Enhancement New feature or request Major This issue or PR contains major changes Complete The code review for this issue has been completed; and is now being finalized. and removed API Break labels Jun 17, 2023
@john-bv john-bv linked a pull request Aug 21, 2023 that will close this issue
@NetrexMC NetrexMC locked and limited conversation to collaborators Sep 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Complete The code review for this issue has been completed; and is now being finalized. Enhancement New feature or request Major This issue or PR contains major changes
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants