Add the following code to your project's shard.yml under:
to use in production
- OR -
development_dependencies to use in development
Clustering class implements simple clustering logic through etcd as a distributed consistent key-value store.
on_stable callback is fired for the leader once the cluster has stabilized.
$ shards build will create a simple proof of concept app, run it with
stabilize : Array(NamedTuple(ip: String, port: Int32)) -> Void arg of
Clustering defines the class's stabilization logic that is fired upon cluster join, leave, and election events.
The array of node data is all of the nodes in the cluster.
A single etcd lease is granted per node so if a node drops out of the cluster, all associated key/values will expire from the cluster.
There are 4 etcd watchfeeds