New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

co-parallel

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

co-parallel

parallel execution with concurrency control

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
327
decreased by-39.67%
Maintainers
1
Weekly downloads
 
Created
Source

co-parallel

Parallel execution with concurrency support that maintains result ordering.

Installation

$ npm install co-parallel

Example

var parallel = require('co-parallel');
var request = require('co-request');
var co = require('co');

var urls = [
  'http://google.com',
  'http://yahoo.com',
  'http://ign.com',
  'http://cloudup.com',
  'http://myspace.com',
  'http://facebook.com',
  'http://segment.io'
];

function *status(url) {
  console.log('GET %s', url);
  return (yield request(url)).statusCode;
}

co(function *(){
  var reqs = urls.map(status);
  var res = yield parallel(reqs, 2);
  console.log(res);
})();

API

parallel(thunks, [concurrency])

Execute thunks in parallel, with the given concurrency defaulting to 5.

License

MIT

Keywords

FAQs

Package last updated on 04 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc