Skip to content

Stabilize support for async runtimes #2643

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

Open
cijothomas opened this issue Feb 11, 2025 · 3 comments
Open

Stabilize support for async runtimes #2643

cijothomas opened this issue Feb 11, 2025 · 3 comments

Comments

@cijothomas
Copy link
Member

Parent issue to track:

  1. Move the runtime and associated trait from behind experimental feature flag. This requires thoroughly reviewing the public API and trim any excess.
  2. Provide implementation of thread-based using runtime trait. (And keep it default)
  3. Provide implementation of runtime for tokio,async-std. (It exists today, but under experimental ff.)
  4. Add tests for each implementation. (integration test too)
  5. Provide ability to bring your-own-runtime (again, this is available but behind experimental ff)
@lalitb
Copy link
Member

lalitb commented Feb 11, 2025

Thanks for raising the issue. I had some work done for thread based runtime in #2390. Happy to take this forward.

@martintmk
Copy link
Contributor

The #2641 PR cleans up the the Runtime trait and it should help with the step 1.

@cijothomas
Copy link
Member Author

#2641 (comment) Ping here. We might want to further trim it.. A trait with just one method is much easier to stabilize for 1.0. Need to explore and see if this is actually possible or not.

trait runtime
spawn_background_job(fn);

thread implementation:
Create dedicated thread

tokio implementation:
tokio:spawn_blocking

We also need to consider #2697 (comment) otherwise, internal-logs won't flow unless global_tracing_subscriber is enabled. @Sushisource's suggestion to accept a thread-start hook is reasonable, and can be achieved with the above model - user decides how the background job is done, and they can decide to setup thread-local tracing_subscriber or global or do nothing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants