danielstjules / redislock

Node distributed locking using redis
MIT License
110 stars 32 forks source link

should i keep use one lock instance in my project ? #8

Closed sunkuo closed 7 years ago

sunkuo commented 7 years ago

Hello, man , I wanna to get suggested about which kind of strategy to pick when using RedisLock

  1. Keep one lock instance in my project , and Initialize the lock when the project setup 2.Initialize the lock in function clause . so it will destroyed when function quit

Which one do you prefer?

danielstjules commented 7 years ago

Having multiple locks is probably a more common scenario in projects than just reusing a single lock, but depends on what you're doing!