feat(cluster): rewrite cluster discovering

* Discovering process adapted from EventStore scala client
* Use DNS for first discover but also for reconnoctions (the aim is to be able to reconnect even if all nodes have new IP addresses eg. after rolling update in a cloud environment)
* Being able to perform proper unit testing
This commit is contained in:
maniolias
2020-09-14 17:29:58 +02:00
parent eb56e077f9
commit f79a0444f6
12 changed files with 1146 additions and 20 deletions

View File

@ -1,7 +1,8 @@
function GossipSeed(endPoint, hostName) {
function GossipSeed(endPoint, hostName, hostHeader) {
if (typeof endPoint !== 'object' || !endPoint.host || !endPoint.port) throw new TypeError('endPoint must be have host and port properties.');
this.endPoint = endPoint;
this.hostName = hostName;
this.hostHeader = hostHeader;
Object.freeze(this);
}