58
you are viewing a single comment's thread
view the rest of the comments
[-] tatterdemalion@programming.dev 1 points 1 month ago* (last edited 1 month ago)

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 1 month ago

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 1 month ago

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

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

Rust

5926 readers
22 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