hedge_rs/
lib.rs

1//! A cluster membership Rust library. It is built on [spindle-rs](https://github.com/flowerinthenight/spindle-rs), a
2//! distributed locking library built on [Cloud Spanner](https://cloud.google.com/spanner/) and
3//! [TrueTime](https://cloud.google.com/spanner/docs/true-time-external-consistency). It is a port (subset only) of
4//! the original [hedge](https://github.com/flowerinthenight/hedge), which is written in Go. Ported features include:
5//!
6//! * Tracking of member nodes - good for clusters with sizes that can change dynamically overtime, such as [GCP MIGs](https://cloud.google.com/compute/docs/instance-groups#managed_instance_groups), and [Kubernetes Deployments](https://kubernetes.io/docs/concepts/workloads/controllers/deployment/);
7//! * Leader election - the cluster elects and maintains a single leader node at all times;
8//! * List of members - get a list of all member nodes at any time;
9//! * Send - any member node can send messages to the leader at any time; and
10//! * Broadcast - any member node can broadcast messages to all nodes at any time.
11
12pub mod hedge;
13mod protocol;
14
15pub use hedge::{Broadcast, Comms, Op, OpBuilder};
16
17#[macro_use(defer)]
18extern crate scopeguard;