A minimal implementation of the fault-tolerant job scheduler.
-
Fault-tolerant
No single point of failure, just setup multiple Cron instances on different machines.
-
Exactly-once
The same job, although scheduled simultaneously by multiple Cron instances, is guaranteed to be executed exactly once per execution time of its schedule.
This guarantee is provided by leveraging distributed locks. The example implementation is based on Redis with a single instance. For higher safety and reliability, you can use other Raft-based implementations of distributed locks (e.g. Consul, etcd).
-
Embeddable
No need to run standalone binaries, you can just embed Cron instances into your existing application, which may consist of one or multiple nodes.
$ go get -u github.com/RussellLuo/micron
See example.
Checkout the Godoc.