{"id":21082277,"url":"https://github.com/olsonpm/promise-concurrency-pool","last_synced_at":"2026-07-09T17:31:02.121Z","repository":{"id":80606689,"uuid":"73326271","full_name":"olsonpm/promise-concurrency-pool","owner":"olsonpm","description":null,"archived":false,"fork":false,"pushed_at":"2016-11-10T14:49:59.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"dev","last_synced_at":"2025-10-26T05:40:17.690Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olsonpm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-11-09T22:26:51.000Z","updated_at":"2016-11-09T23:11:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"0f887e0d-7ab2-43d0-b2ce-c91c43bb0e69","html_url":"https://github.com/olsonpm/promise-concurrency-pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/olsonpm/promise-concurrency-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpromise-concurrency-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpromise-concurrency-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpromise-concurrency-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpromise-concurrency-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olsonpm","download_url":"https://codeload.github.com/olsonpm/promise-concurrency-pool/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpromise-concurrency-pool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35308362,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-09T02:00:07.329Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T20:13:30.749Z","updated_at":"2026-07-09T17:31:02.099Z","avatar_url":"https://github.com/olsonpm.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Promise Concurrency Pool\n\n## Why create this module?\n\nI needed the ability to add to a pool from multiple places in my application.\nI didn't feel like hacking my application to fit the api provided\nby es6-promise-pool\n\n## Contrived Example\n\n```js\n\n// some helpers\nconst log = console.log\n  , bPromise = require('bluebird');\n\nconst wait = ms =\u003e ({\n  thenLog: msg =\u003e ({\n    fn: () =\u003e bPromise.delay(ms).then(() =\u003e log(msg))\n  })\n});\n\n// now create the pool\nconst myPool = require('promise-concurrency-pool')\n  .create({ size: 2, onSettled: () =\u003e log('empty!') });\n\nmyPool.add(wait(15).thenLog('third').fn)\n  .add(wait(5).thenLog('first').fn)\n  .add(wait(2).thenLog('second').fn);\n\n// prints\n//\n// first\n// second\n// third\n// empty!\n```\n\n## API\n\n`require('promise-concurrency-pool')` returns an object with a single\nproperty `create`.\n\n`create(argsObj) -\u003e pool`\n\nwhere `argsObj` is an object with the properties\n\n```\nsize \u003cint\u003e\n *required\n - the size of the pool\n\nonSettled \u003cfunction\u003e\n - a function to call every time the pool settles (no active promises in\n   the pool)\n```\n\nand `pool` is an object with the properties\n```\nadd(promiseFn) -\u003e pool\n *chainable\n - 'promiseFn' is a 'promise-returning-function'\n - adds promiseFn to a queue.  When a promise in the pool finishes, it grabs one\n   from this queue until empty.\n\nsize \u003cint\u003e\n *readonly\n - the size of the pool\n```\n\n## Test\n\n`npm test`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsonpm%2Fpromise-concurrency-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folsonpm%2Fpromise-concurrency-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsonpm%2Fpromise-concurrency-pool/lists"}