{"id":18408895,"url":"https://github.com/chmoder/worker-promise-pool","last_synced_at":"2025-06-12T01:09:46.886Z","repository":{"id":66821484,"uuid":"65103303","full_name":"chmoder/worker-promise-pool","owner":"chmoder","description":"Pool of Web Workers that return promises on message events","archived":false,"fork":false,"pushed_at":"2018-12-08T17:00:56.000Z","size":34,"stargazers_count":0,"open_issues_count":1,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T22:59:41.322Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chmoder.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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,"zenodo":null}},"created_at":"2016-08-06T21:43:19.000Z","updated_at":"2016-08-06T21:44:59.000Z","dependencies_parsed_at":"2023-04-23T06:33:10.658Z","dependency_job_id":null,"html_url":"https://github.com/chmoder/worker-promise-pool","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/chmoder/worker-promise-pool","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmoder%2Fworker-promise-pool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmoder%2Fworker-promise-pool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmoder%2Fworker-promise-pool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmoder%2Fworker-promise-pool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chmoder","download_url":"https://codeload.github.com/chmoder/worker-promise-pool/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chmoder%2Fworker-promise-pool/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259374948,"owners_count":22847873,"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","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-06T03:22:12.936Z","updated_at":"2025-06-12T01:09:46.878Z","avatar_url":"https://github.com/chmoder.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# worker-promise-pool\nPool of Web Workers that return promises on worker message events.\n\nCreate your pool by passing the number of workers you wouild like and the path to the worker script your workers will execute.\n\nThen create a WorkerPromise, workload is the data the worker needs during execution.\nSet onmessage to a callback you would like executed after your worker completes.  Callback will have the data from the worker script if you put include it in the \"postMessage\" of your worker script.\n\n[Try the example!](https://chmoder.github.io/worker-promise-pool/)\n\n\n```javascript\n// create a pool for working on WorkerPromise's with a given number of workers\nvar numberOfWorkers = 8;\nvar workerPool = new WorkerPool(numberOfWorkers, 'js/example_worker.js');\n\nvar callback = function(data) {\n  // do something with data from worker\n}\n\nvar workerPromise = new WorkerPromise();\n// args to pass to worker\nworkerPromise.workload = [];\n// callback for when the worker completes its task\nworkerPromise.onmessage = callback;\n// add WorkerPromise to the pool and queue it up for execution\nworkerPool.addWorkerPromise(workerPromise);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchmoder%2Fworker-promise-pool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchmoder%2Fworker-promise-pool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchmoder%2Fworker-promise-pool/lists"}