Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gocsp-limit

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

gocsp-limit

Parallel execution with max concurrency limit.

  • 0.0.2
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gocsp-limit

Parallel execution with max concurrency limit.

Installation

$ npm install gocsp-limit

Example

var go = require('gocsp-go')
var limit = require('gocsp-limit')
var thunk = require('gocsp-thunk')
var readFile = thunk.ify(require('fs').readFile)

go(function* () {
    var files = yield [
        'example.js',
        'index.js',
        'package.json',
        'README.md',
        'test.js'
    // parallel execution with max concurrency 3
    ].map(limit.wrap(3, function* (filename) {
        return yield readFile(__dirname + '/' + filename, 'utf8')
    }))
})

API

limit( concurrency )

like go in gocsp-go, but with max concurrency limit

Example:

var limitGo = limit(5)
for (var i = 0; i < 10; i++) {
    limitGo(function* () {
        // max 5 concurrency
        // ...
    })
}

limit.wrap( concurrency, generatorFunction )

like go.wrap in gocsp-go, but with max concurrency limit

Example:

go(function* () {
    var files = yield [
        'example.js',
        'index.js',
        'package.json',
        'README.md',
        'test.js'
    // parallel execution with max concurrency 3
    ].map(limit.wrap(3, function* (filename) {
        return yield readFile(__dirname + '/' + filename, 'utf8')
    }))
})

License

MIT

FAQs

Package last updated on 27 Nov 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