Popularity
7.2
Growing
Activity
2.0
-
721
9
94
Programming language: Go
License: GNU General Public License v3.0 or later
Tags:
Distributed Systems
Latest version: v0.7.1
redis-lock alternatives and similar packages
Based on the "Distributed Systems" category.
Alternatively, view redis-lock alternatives based on common mentions on social networks and blogs.
-
Nomad
Nomad is an easy-to-use, flexible, and performant workload orchestrator that can deploy a mix of microservice, batch, containerized, and non-containerized applications. Nomad is easy to operate and scale and has native Consul and Vault integrations. -
go-zero
go-zero is a web and rpc framework written in Go. It's born to ensure the stability of the busy sites with resilient design. Builtin goctl greatly improves the development productivity. [Moved to: https://github.com/zeromicro/go-zero] -
rpcx
Best microservices framework in Go, like alibaba Dubbo, but with more features, Scale easily. Try it. Test it. If you feel it's better, use it! ๐๐๐ฏ๐ๆ๐๐ฎ๐๐๐จ, ๐๐จ๐ฅ๐๐ง๐ ๆ๐ซ๐ฉ๐๐ฑ! build for clound! -
ringpop-go
Scalable, fault-tolerant application-layer sharding for Go applications -
KrakenD
Ultra performant API Gateway with middlewares. A project hosted at The Linux Foundation -
dragonboat
A feature complete and high performance multi-group Raft library in Go. -
emitter-io
High performance, distributed and low latency publish-subscribe platform. -
glow
Glow is an easy-to-use distributed computation system written in Go, similar to Hadoop Map Reduce, Spark, Flink, Storm, etc. I am also working on another similar pure Go system, https://github.com/chrislusf/gleam , which is more flexible and more performant. -
gleam
Fast, efficient, and scalable distributed map/reduce system, DAG execution, in memory or on disk, written in pure Go, runs standalone or distributedly. -
Dkron
Dkron - Distributed, fault tolerant job scheduling system https://dkron.io -
Olric
Distributed in-memory data structure store. It can be used both as an embedded Go library and as a language-independent service. -
hprose
Hprose is a cross-language RPC. This project is Hprose for Golang. -
go-doudou
go-doudou๏ผdoudou pronounce /dษudษu/๏ผis OpenAPI 3.0 spec based lightweight microservice framework. It supports monolith service application as well. Currently, it supports RESTful service only. ไธญๆๆๆกฃๅฐๅ๏ผhttps://go-doudou.unionj.cloud -
go-health
Library for enabling asynchronous health checks in your service -
resgate
A Realtime API Gateway used with NATS to build REST, real time, and RPC APIs, where all your clients are synchronized seamlessly. -
arpc
More effective network communication, two-way calling, notify and broadcast supported. -
go-sundheit
A library built to provide support for defining service health for golang services. It allows you to register async health checks for your dependencies and the service itself, provides a health endpoint that exposes their status, and health metrics. -
sleuth
A Go library for master-less peer-to-peer autodiscovery and RPC between HTTP services -
Maestro
Take control of your data, connect with anything, and expose it anywhere through protocols such as HTTP, GraphQL, and gRPC. -
celeriac
Golang client library for adding support for interacting and monitoring Celery workers, tasks and events. -
drmaa
Compute cluster (HPC) job submission library for Go (#golang) based on the open DRMAA standard. -
go-pdu
Parallel Digital Universe - A decentralized social networking service -
flowgraph
Flowgraph package for scalable asynchronous system development -
dynatomic
Dynatomic is a library for using dynamodb as an atomic counter
Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
SonarLint is a free and open source IDE extension that identifies and catches bugs and vulnerabilities as you code, directly in the IDE. Install from your favorite IDE marketplace today.
Promo
www.sonarlint.org
Do you think we are missing an alternative of redis-lock or a related project?
README
redislock
Simplified distributed locking implementation using Redis. For more information, please see examples.
Examples
import (
"fmt"
"time"
"github.com/bsm/redislock"
"github.com/go-redis/redis/v8"
)
func main() {
// Connect to redis.
client := redis.NewClient(&redis.Options{
Network: "tcp",
Addr: "127.0.0.1:6379",
})
defer client.Close()
// Create a new lock client.
locker := redislock.New(client)
ctx := context.Background()
// Try to obtain lock.
lock, err := locker.Obtain(ctx, "my-key", 100*time.Millisecond, nil)
if err == redislock.ErrNotObtained {
fmt.Println("Could not obtain lock!")
} else if err != nil {
log.Fatalln(err)
}
// Don't forget to defer Release.
defer lock.Release(ctx)
fmt.Println("I have a lock!")
// Sleep and check the remaining TTL.
time.Sleep(50 * time.Millisecond)
if ttl, err := lock.TTL(ctx); err != nil {
log.Fatalln(err)
} else if ttl > 0 {
fmt.Println("Yay, I still have my lock!")
}
// Extend my lock.
if err := lock.Refresh(ctx, 100*time.Millisecond, nil); err != nil {
log.Fatalln(err)
}
// Sleep a little longer, then check.
time.Sleep(100 * time.Millisecond)
if ttl, err := lock.TTL(ctx); err != nil {
log.Fatalln(err)
} else if ttl == 0 {
fmt.Println("Now, my lock has expired!")
}
}
Documentation
Full documentation is available on GoDoc
*Note that all licence references and agreements mentioned in the redis-lock README section above
are relevant to that project's source code only.