this post was submitted on 05 Sep 2024
57 points (100.0% liked)

Rust

6003 readers
14 users here now

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits

  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)

founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
[–] tatterdemalion@programming.dev 1 points 2 months ago* (last edited 2 months ago) (1 children)

I'm not sure what tokio (or axum) can do to avoid the trait bounds. Would it makes sense to provide a "share nothing" runtime implementation that can be injected at startup? I wonder how the intermediate layers (e.g. axum) would indicate that futures are usable by a more generic runtime which may or may not need Send + 'static.

Without some way to write generic code for either runtime, the whole tokio ecosystem would end up bifurcated by this choice of runtime.

[–] Giooschi@lemmy.world 1 points 2 months ago (1 children)

Would it makes sense to provide a "share nothing" runtime implementation that can be injected at startup?

Isn't this tokio::task::spawn_local?

[–] tatterdemalion@programming.dev 1 points 2 months ago

Not exactly. I'm talking specifically about being able to call axum::serve with non-Send futures.