quinn icon indicating copy to clipboard operation
quinn copied to clipboard

Named futures + replace NewConnection with Connection methods

Open Ralith opened this issue 3 years ago • 4 comments

Experimenting with a return to named 'static futures, motivated by downstream use cases. See e.g. https://github.com/hyperium/h3/pull/80.

Open questions:

  • Which interfaces specifically need to be named?
  • Is 'static needed, or just names?
  • Are GATs + TAIT close enough that none of this matters?

Also included is an idea to drop NewConnection in favor of unobtrusive async methods on Connection, bundled because they would have to be rewritten to match this PR's approach if it move forwards. I'd like feedback on this change before I invest the effort to actually remove NewConnection and update all the examples/docs.

Ralith avatar May 12 '22 05:05 Ralith

Sorry for the slow review...

djc avatar May 23 '22 09:05 djc

No worries; it's not particularly pressing, nor a rebase hazard.

Ralith avatar May 23 '22 18:05 Ralith

Still TODO: Actually getting rid of NewConnection, unless there's a compelling reason to keep it around.

Ralith avatar Sep 18 '22 19:09 Ralith

That seems to have panned out to a pleasant simplification in the tests/examples. Less unwrap, less nesting, and fewer intermediate variables all 'round.

Ralith avatar Sep 18 '22 20:09 Ralith