{"repo":"jefferyjob/go-redislock","free":true,"listed":false,"github":"https://github.com/jefferyjob/go-redislock","clone":"git clone https://github.com/jefferyjob/go-redislock.git","description":"High-performance Redis distributed lock service based on Go language. 基于Go语言实现的高性能Redis分布式锁服务。","language":"Go","stars":443,"topics":["go","lock","redis","sync","distributed","reentrant","spinlock"],"license":"MIT","category":"databases-storage","readme_excerpt":"go-redislock English 简体中文 Introduce go-redislock is a library for Go that provides distributed lock functionality using Redis as the backend storage. Ensure data sharing and resource mutual exclusion under concurrent access in a distributed environment. Our distributed lock has the characteristics of reliability, high performance, timeout mechanism, reentrancy and flexible lock release method, which simplifies the use of distributed lock and allows you to focus on the realization of business logic. We implemented the following key capabilities: - 🔒 Standard distributed locks (reentrant) - 🔁 Spin locks - ⚖️ Fair locks (FIFO order) - 🧵Read lock (multiple readers access concurrently, mutually exclusive writers) - ✍️Write lock (exclusive access to a resource) - 🔄 Manual and automatic renewal - ✅ Compatibility with multiple Redis clients (v7/v8/v9, go-zero) Quick start Install Use Demo Configuration options Option function Description Default value ----------------------------------- ------------------ --------- WithTimeout(d time.Duration) Lock timeout (TTL) 5s WithAutoRenew() Whether to automatically renew false WithToken(token string) Reentrant lock Token (unique identifier) Random UUID WithRequestTimeout(d time.Duration) Maximum waiting time for fair lock queue Same as TTL Core Function Overview Normal Lock Method Name Description ------------------------------ ------------------------ Lock(ctx) Acquire a normal lock (supports reentrancy) SpinLock(ctx, timeout) Acquire a n","default_branch":null,"files":null,"tree":[],"storefront":"/r/jefferyjob","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/jefferyjob/go-redislock/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}