1.0.1 • Published 3 years ago

node-synchronized v1.0.1

Weekly downloads
3
License
Apache-2.0
Repository
github
Last release
3 years ago

node-synchronized

import { Synchronized }  from 'node-synchronized';

const block = new Synchronized();

block.synchronized((isFirst) => {
  // When acquiring the first lock, isFirst == true.
});

block.synchronized((first) => {
  // When acquiring the first lock, isFirst == true.
});

example

example.ts

output:

A: isFirst=true
B: isFirst=false

C: isFirst=true
D: isFirst=false

License

Apache-2.0 License