• @[email protected]
    link
    fedilink
    1
    edit-2
    2 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
      link
      English
      12 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?

      • @[email protected]
        link
        fedilink
        12 months ago

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