danielstjules / redislock

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

SETNX example #11

Closed patrikx3 closed 7 years ago

patrikx3 commented 7 years ago

hi! thanks for helping. just asking, i just need to create a new session id, like uuid. it says this is the simple use case, but i dont get it. what do i do with the lock? i just want to add a new unique id if it doesn't exist , how do i do it?

thanks so much! ciao!

danielstjules commented 7 years ago

Sounds like this might not be the right library for you, as you don't need a lock at all. If you want a unique session id in redis, I'd suggest using one of the following based on your env:

Hope that helps!