• tatterdemalion@programming.dev
    link
    fedilink
    arrow-up
    1
    ·
    edit-2
    4 months 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
      link
      fedilink
      English
      arrow-up
      1
      ·
      4 months 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?