mycognosist / solar

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

Add connection scheduler #63

Closed mycognosist closed 1 year ago

mycognosist commented 1 year ago

Here's my first-pass at a very basic connection scheduler:

There are two connection queues: eager and lazy (think of better names). All peers-to-be-dialed start in the eager queue and one peer is dialed every n seconds. If a connection attempt fails, the peer is moved to the lazy queue. One peer from the lazy queue is dialed every n x 10 seconds (or similar). If a connection attempt succeeds, the peer is moved back to the eager queue.