Guest User

Untitled

a guest
Jun 19th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. const lock = hazelcast.getLock('my-distributed-lock')
  2. lock.lock().then(() => {
  3. // the execution of this function will happen once
  4. // at a time across all distributed instances
  5. // ...
  6. console.log('Happy Locking!')
  7. }).finally(() => lock.unlock())
Add Comment
Please, Sign In to add comment