Comments (3)
Sorry, there is no Locker
object, just Client
and Lock
. You should obtain a fresh lock every time you need it. Calling Refresh
is an option to extend the TTL but not much more.
from redislock.
Sorry, I went by the variable name. The client variable was named 'locker' and I referred to that only.
Could you please tell me the best practice for the Client
object. Should it be at global scope or local to the scope where the lock is being obtained.
Thanks.
from redislock.
You only ever need one instance, it is thread-safe and can create many locks. From a performance/allocation point if view it would be beneficial to initialise it only once, but that's really implementation specific and for you to decide.
from redislock.
Related Issues (20)
- Add context param to all functions and methods that make calls to redis HOT 1
- Please Follow Semantic Import Versioning HOT 2
- Can release the lock when ctx deadline exceeded HOT 1
- the Obtain may be have a problem HOT 1
- Two questions about the implementation HOT 1
- A question about ttl HOT 5
- Does not redislock work properly with multiple Go gin API at a time? HOT 4
- No provision for using KeepTTL option of redis server itself
- redis/v8 support HOT 2
- How to get lock with a key HOT 16
- Doesn't work with redis/v9 HOT 3
- Is it still working on goredis v8? HOT 1
- RedisClient error HOT 8
- README Examples Can't run HOT 1
- please ignore HOT 1
- Should here return `context.Cause(ctx)` or the error warp with `context.Cause(ctx)` when `ctx.Done()` ? HOT 2
- lock.Release() unable to release lock. HOT 3
- panic HOT 4
- when obtain have retry, hope the lock ttl will auto delay HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redislock.