{"id":32412040,"url":"https://github.com/ming-codes/fpool","last_synced_at":"2025-10-25T14:52:11.783Z","repository":{"id":17434605,"uuid":"20207977","full_name":"ming-codes/fpool","owner":"ming-codes","description":null,"archived":false,"fork":false,"pushed_at":"2017-02-14T00:54:39.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2023-03-12T22:25:26.809Z","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/ming-codes.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}},"created_at":"2014-05-27T05:22:35.000Z","updated_at":"2014-07-03T19:09:16.000Z","dependencies_parsed_at":"2022-08-04T19:15:29.049Z","dependency_job_id":null,"html_url":"https://github.com/ming-codes/fpool","commit_stats":null,"previous_names":[],"tags_count":0,"template":null,"template_full_name":null,"purl":"pkg:github/ming-codes/fpool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ming-codes%2Ffpool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ming-codes%2Ffpool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ming-codes%2Ffpool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ming-codes%2Ffpool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ming-codes","download_url":"https://codeload.github.com/ming-codes/fpool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ming-codes%2Ffpool/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280971728,"owners_count":26422675,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"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":"2025-10-25T14:52:04.936Z","updated_at":"2025-10-25T14:52:11.774Z","avatar_url":"https://github.com/ming-codes.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\nNodeJS fork pool with option to use as worker pool\n\n# fpool - Work in Progress\n\nNodeJS fork pool with option to use as worker pool\n\n## Installation\n\n```bash\n$ npm install git+https://github.com/lightblade/fpool.git\n```\n\nModule not yet published\n\n## API\n\n### WorkerPool\n\n#### constructor\n\n1. path to forked module\n2. argv passed to the starting process\n3. options: very similar to `child_process.spawn`, except...\n  * execPath will be used as the script to launch to node process\n  * execArgv any node specific launch options\n  * size maximum number of process to spawn\n\n#### enqueue(job)\n\nSend job to next available worker.\n\n### MessageQueue\n\nThe message queue consists of only one exported function.\n\n#### ready(fn)\n\n1. fn(job, [callback])\n  1. job assigned job to this worker\n  2. [callback] optional callback of signature function(err, data)\n\n  * *return* either...\n    * nothing (synchronous call)\n    * thunk (asynchronous call)\n    * promise(asynchronous call)\n\n## Example\n\n```javascript\n\nvar WorkerPool = require('fpool')\n\n// equivilent to\n// spawn('/usr/local/bin/node', [ '--harmony', '/usr/local/bin/coffee', '--argv', 'path/to/module' ])\npool = new WorkerPool('path/to/module', [ '--argv' ], {\n  execPath: '/usr/local/bin/coffee',\n  execArgv: '--harmony',\n  size: 4\n})\n\npool.enqueue('job')(function(err, data) {\n  // done!\n})\n\n```\n\n```javascript\n\nvar onReady = require('fpool/mq')\n\nonReady(function(job, [callback]) {\n  // sync\n  return minify(job)\n\n  // thunk\n  return function(callback) {\n  }\n\n  // promise\n  return new Promise(function(resolve, reject) {\n  })\n})\n\n```\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fming-codes%2Ffpool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fming-codes%2Ffpool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fming-codes%2Ffpool/lists"}