network
network copied to clipboard
refactor(dht): Extract `ConnectionsView`
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
transportandconnectionLockerinstances are dependencies of aDhtNodeobject. Therefore we should pass those instances inDhtNode's config instead of creating aConnectionManagerinstance internally. This would enhance module boundaries and make testing siginificantly easier. There is currently a circular dependency betweenDhtNodeandConnectionManager, which makes this implementation non-trivial.