Registry / messaging / go-redsync-redsync

go-redsync-redsync

JSON →
library1.4.2gogounverified

Package redsync provides a distributed mutual exclusion lock using Redis.

go get github.com/go-redsync/redsync
INSTALL
IMPORT
SIG · GO-REDSYNC-REDSYNC
G
go-redsync-redsync
messaginggov1.4.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

redsync
github.com/go-redsync/redsync

Acquire a distributed lock with Redis

package main import ( "fmt" "github.com/go-redsync/redsync" "github.com/gomodule/redigo/redis" ) func main() { pool := &redis.Pool{Dial: func() (redis.Conn, error) { return redis.Dial("tcp", ":6379") }} rs := redsync.New([]redsync.Pool{pool}) mutex := rs.NewMutex("my-lock") if err := mutex.Lock(); err != nil { fmt.Println("Lock failed") } else { fmt.Println("Lock acquired") mutex.Unlock() } }
Debug
Known issues

No known issues recorded.

Upgrade
Version history
1.4.2latest on pkg.go.dev
Audit
Dependencies

No dependency data recorded yet.

Agent activity
22 hits · last 30 days
node
20
Amazon
1
OpenAI (training)
1
Resources
go-redsync-redsync — go get go-redsync-redsync · libregistry