compatible-pool
[![Build Status](https://travis-ci.org/fabiosantoscode/compatible-pool.svg?branch=master)](https://travis-ci.org/fabiosantoscode/compatible-pool) [![Coverage Status](https://coveralls.io/repos/github/fabiosantoscode/compatible-pool/badge.svg?branch=master
Last updated 2 years ago by fabiosantoscode .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install compatible-pool 
SYNC missed versions from official npm registry.

compatible-pool

Build Status Coverage Status

Runs a map function on a set of values. The function will run on as many processors your machine has, or on max processes.

new Pool({ max: number, create: async () => res, destroy: res => (destroys res) })

  • max: maximum number of parallel processes
  • create: return your resource here as a promise
  • destroy: destroy your resource

pool.acquire() -> Promise<res>

Aquire a resource from the pool. This can take longer if the maximum number of processes has been reached.

pool.release(res)

Release a resource in the pool.

pool.clear()

Clear everything in the pool.

Current Tags

  • 1.0.1                                ...           latest (2 years ago)

2 Versions

  • 1.0.1                                ...           2 years ago
  • 1.0.0                                ...           2 years ago
Maintainers (1)
Downloads
Today 0
This Week 3
This Month 3
Last Day 0
Last Week 4
Last Month 8
Dependencies (2)
Dev Dependencies (6)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |