mycognosist / solar

A minimal Secure Scuttlebutt replication node.
Other
20 stars 2 forks source link

Add a basic connection scheduler #66

Closed mycognosist closed 1 year ago

mycognosist commented 1 year ago

Addresses https://github.com/mycognosist/solar/issues/63

The main addition of the PR is the connection scheduler module. I've chosen to begin with a very simple implementation. The flow is as follows:

I've introduced the ConnectionData struct in the connection manager which allows the passing of the connection ID, remote peer address and remote peer public key for each connection. The connection data is passed along with each ConnectionEvent emitted during the connection and replication lifecycle.

That's really all there is to it. The connection scheduler listens for connection events to determine the post-connection placement of each peer.


I'll aim to further refine the separation of concerns in the next PR (for example, moving modifications of the CONNECTED_PEERS vector out of the secret handshake and replication modules and into the connection manager).

This is fun!