event-loop-spinner
Tiny helper to prevent blocking Node.js event loop
Last updated 3 years ago by snyk-admin .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ gnpm install event-loop-spinner 
SYNC missed versions from official npm registry.

event-loop-spinner

Tiny helper to prevent blocking Node.js event loop.

Example

import { eventLoopSpinner } from 'event-loop-spinner';
async function cpuIntensiveOperationHandler(hugeArray) {
  for (const item of hugeArray) {
    // ...
    if (eventLoopSpinner.isStarving()) {
      await eventLoopSpinner.spin();
    }
  }
}

Reading

Node.js: How even quick async functions can block the Event-Loop, starve I/O

Current Tags

  • 2.2.0                                ...           latest (3 years ago)

5 Versions

  • 2.2.0                                ...           3 years ago
  • 2.1.0                                ...           4 years ago
  • 2.0.0                                ...           5 years ago
  • 1.1.0                                ...           5 years ago
  • 1.0.1                                ...           5 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (1)
Dev Dependencies (11)

Copyright 2013 - present © cnpmjs.org | Home |