{"id":18980468,"url":"https://github.com/ecollect/pateka","last_synced_at":"2026-05-18T14:03:01.110Z","repository":{"id":33148382,"uuid":"153244079","full_name":"eCollect/pateka","owner":"eCollect","description":"Ordered pararallel asynchronous tasks.","archived":false,"fork":false,"pushed_at":"2023-01-05T03:54:36.000Z","size":362,"stargazers_count":0,"open_issues_count":11,"forks_count":0,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-02-01T15:02:27.220Z","etag":null,"topics":["async","await","nodejs","parallel","promise","queue","tasks","worker"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eCollect.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-16T07:46:34.000Z","updated_at":"2019-12-30T14:54:31.000Z","dependencies_parsed_at":"2023-01-14T23:36:53.773Z","dependency_job_id":null,"html_url":"https://github.com/eCollect/pateka","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fpateka","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fpateka/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fpateka/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eCollect%2Fpateka/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eCollect","download_url":"https://codeload.github.com/eCollect/pateka/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239985731,"owners_count":19729515,"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":["async","await","nodejs","parallel","promise","queue","tasks","worker"],"created_at":"2024-11-08T16:06:54.959Z","updated_at":"2025-11-11T14:01:57.937Z","avatar_url":"https://github.com/eCollect.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\t\u003cimg src=\"img/pateka.png\" width=\"200px\" height=\"auto\"/\u003e\n\u003c/p\u003e\n\n\u003ch1 align=\"center\"\u003epateka - ordered parallel asynchronous tasks\u003c/h1\u003e\n\n\u003cp align=\"center\"\u003e\u003ca href=\"https://travis-ci.com/eCollect/pateka\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/15b2fa131b197201791679d480e8a1739d091eba/68747470733a2f2f7472617669732d63692e636f6d2f65436f6c6c6563742f706174656b612e7376673f6272616e63683d6d6173746572\" alt=\"travis\" data-canonical-src=\"https://travis-ci.com/eCollect/pateka.svg?branch=master\" style=\"max-width:100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://www.npmjs.com/package/pateka\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/fc6c846dbdf7eb28896b6611cc1ec2278d9b49b1/68747470733a2f2f62616467652e667572792e696f2f6a732f706174656b612e737667\" alt=\"npm version\" data-canonical-src=\"https://badge.fury.io/js/pateka.svg\" style=\"max-width:100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://coveralls.io/github/eCollect/pateka?branch=master\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/371601014a369cdc5495c8542cdb74703e4828f3/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f65436f6c6c6563742f706174656b612f62616467652e7376673f6272616e63683d6d6173746572\" alt=\"Coverage Status\" data-canonical-src=\"https://coveralls.io/repos/github/eCollect/pateka/badge.svg?branch=master\" style=\"max-width:100%;\"\u003e\u003c/a\u003e \u003ca href=\"https://snyk.io/test/github/eCollect/pateka?targetFile=package.json\" rel=\"nofollow\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/e560e08aab5b523c56785ac8d7b5c6fc787c5c93/68747470733a2f2f736e796b2e696f2f746573742f6769746875622f65436f6c6c6563742f706174656b612f62616467652e7376673f74617267657446696c653d7061636b6167652e6a736f6e\" alt=\"Known Vulnerabilities\" data-canonical-src=\"https://snyk.io/test/github/eCollect/pateka/badge.svg?targetFile=package.json\" style=\"max-width:100%;\"\u003e\u003c/a\u003e \u003ca href=\"/eCollect/pateka/blob/master/LICENSE\"\u003e\u003cimg src=\"https://camo.githubusercontent.com/1e5d6c593654e3673fe4323032b7af9656157b1e/68747470733a2f2f6261646765732e66726170736f66742e636f6d2f6f732f6d69742f6d69742e7376673f763d313033\" alt=\"MIT Licence\" data-canonical-src=\"https://badges.frapsoft.com/os/mit/mit.svg?v=103\" style=\"max-width:100%;\"\u003e\u003c/a\u003e\u003c/p\u003e\n\n## Installation\n\n```shell\n$ npm install pateka\n```\n\n## Usage\n\n\nCreating a new pateka. By default a pateka will be created with (parallel) 256 tracks, each track than will be filled with async tasks based on their routing key. Tasks in the same track ( same routing key ) will be run in order, tracks will be run in parallel.\n\n```javascript\nconst Pateka = require('pateka');\n\nconst Pateka = new Pateka();\n```\n\n### Setting the number of (parallel) tracks\n\nYou can chnage the default number of tracks by passing a `tracks` option to the constructor.\n\n```javascript\nconst Pateka = new Pateka({  tracks: 128 });\n```\n\n\n## Adding tasks\n\nTask are added with the `add` method. You will need to specify an `id` for the task, a `task` function, and a `routingKey`.\n\nThe routingKey will be used to spread tasks into tracks, ensuring that tasks with the same key are always run in the right order and sequence.\n\n```javascript\npateka.add({\n\troutingKey: 'order-1234', // shared between tasks that needs tp be run in sequence\n\tid: '713973e256ab63505cba325344d30dbb', // unique for this task\n\tasync task () {\n\t\t// do some work on this order\n\t}\n});\n\npateka.add({\n  routingKey: 'order-1234', // shared between tasks that needs tp be run in sequence\n  id: ' 2cd96bc0d5b0d2e6520ef04fa9f887b9', // unique for this task\n  async task () {\n\t\t// do some additional work on this order, after the other work has fhinished\n\t}\n});\n```\n\n### Awaiting a task to be done\n\n```javascript\nawait pateka.add({\n  routingKey: 'order-1234', // shared between tasks that needs tp be run in sequence\n  id: ' 2cd96bc0d5b0d2e6520ef04fa9f887b9', // unique for this task\n  async task () {\n\t\t// do some additional work on this order, after the other work has fhinished\n\t}\n});\n```\n\n## License\n\nCopyright (c) 2018 eCollect AG.\nLicensed under the [MIT](LICENSE) license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecollect%2Fpateka","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecollect%2Fpateka","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecollect%2Fpateka/lists"}