network icon indicating copy to clipboard operation
network copied to clipboard

refactor(dht): Extract `ConnectionsView`

Open teogeb opened this issue 1 year ago • 0 comments

Extracted ConnectionsView interface from ITransport. Now ITransport handles just the transport logic. Connection management and queries are in separate classes: in ConnectionLocker and in the new ConnectionsView.

TODO

Extract ConnectionsView functionality from FakeTransport (and maybe also SimulatorTransport if possible).

Future improvements

  • The transport and connectionLocker instances are dependencies of a DhtNode object. Therefore we should pass those instances in DhtNode's config instead of creating a ConnectionManager instance internally. This would enhance module boundaries and make testing siginificantly easier. There is currently a circular dependency between DhtNode and ConnectionManager, which makes this implementation non-trivial.

teogeb avatar Apr 22 '24 16:04 teogeb