0.1.3 • Published 5 years ago

easylock v0.1.3

Weekly downloads
1
License
MIT
Repository
-
Last release
5 years ago

easy use redis red-lock

it's for personal use now. use it for you own risk.

import withLock from 'easylock'

async function exec() {
  
  await withLock('user_id',async ()=>{
    // default red-lock  timeout is 5000 ms
    // do sth with lock to user_id
  })

  // or

  await withLock({key:'user_id', timeOutInMs:500},async ()=>{
    // do sth with lock to user_id with timeout 500ms
  })
}

plan

[] support withLocks(['lock1','lock2'], ...) [] timeout handle [] tests

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

6 years ago