Skip to content
Distributed mutual exclusion lock using Redis for Go
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitlab-ci.yml Update .gitlab-ci.yml Feb 2, 2016
.travis.yml Update .travis.yml Oct 9, 2018
LICENSE Add LICENSE file Feb 20, 2016 Update Jul 28, 2019
VERSION Add VERSION file Feb 20, 2016
doc.go Add package documentation Feb 20, 2016
error.go Define package API Feb 2, 2016
mutex.go Reduce redundant calls to time.Now Sep 15, 2019
mutex_test.go Add a trivial test for failed nodes; closes #12 Apr 5, 2019
redis.go Update redigo import paths Mar 26, 2018
redsync.go Add SetGenValueFunc to set the custom value generator Mar 29, 2019
redsync_test.go Add a trivial test for failed nodes; closes #12 Apr 5, 2019


Build Status

Redsync provides a Redis-based distributed mutual exclusion lock implementation for Go as described in this post. A reference library (by antirez) for Ruby is available at


Install Redsync using the go get command:

$ go get

The only dependencies are the Go distribution and Redigo.



Contributions are welcome.


Redsync is available under the BSD (3-Clause) License.


This code implements an algorithm which is currently a proposal, it was not formally analyzed. Make sure to understand how it works before using it in production environments.

You can’t perform that action at this time.