node-synchronized
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

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

Package Sidebar

Install

npm i node-synchronized

Weekly Downloads

5

Version

1.0.1

License

Apache-2.0

Unpacked Size

33.2 kB

Total Files

12

Last publish

Collaborators

  • jc-lab