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

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    3
  • 1.0.0
    0

Package Sidebar

Install

npm i node-synchronized

Weekly Downloads

3

Version

1.0.1

License

Apache-2.0

Unpacked Size

33.2 kB

Total Files

12

Last publish

Collaborators

  • jc-lab