• @tatterdemalion
    link
    1
    edit-2
    11 days 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.

    • @[email protected]
      link
      fedilink
      English
      111 days 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
        link
        111 days ago

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