Skip to content

Pluggable transport manager

eta requested to merge eta/arti:ptmgr-draft into main

This commit implements PtMgr, a pluggable transport manager responsible for keeping track of spawned PTs and spawning them to satisfy client requests on demand.

It does this in two parts: the PtMgr type exported to the rest of the code, and the background PtReactor that actually does the spawning; this design ensures that only one attempt to spawn a PT is active at a time, and will prove useful later for implementing e.g. timeouts.

[NOTE the reactor isn't actually done yet, and there are still TODOs everywhere; this is a first cut]

A few changes were necessary to the rest of the code in order to make this all work out. Namely:

  • TransportRegistry's API didn't make any sense for two reasons:
    • It wasn't feasible for implementors to implement ChannelFactory, since that'd require constructing a ChanBuilder (which requires a bootstrap reporting event sender).
    • Treating the PT manager as a registry is over-general; it's only necessary for it to spawn pluggable transports, so saddling it with other concerns didn't make any sense.
    • (It's possible to get extensibility for arbitrary user customization by just letting the user swap in a new ChannelFactory, anyway.)
  • Therefore, the PtMgr implements the new AbstractPtMgr trait, which is far more narrowly focused; this only exists to solve a dependency loop, and is documented as such.
    • This provides a TransportHelper instead of a ChannelFactory.

Merge request reports

Loading