{"id":28442077,"url":"https://github.com/guseyn/cutie-cluster","last_synced_at":"2025-06-16T00:06:55.094Z","repository":{"id":57104994,"uuid":"136626351","full_name":"Guseyn/cutie-cluster","owner":"Guseyn","description":"Cutie extension for cluster module in Node.","archived":false,"fork":false,"pushed_at":"2019-05-10T21:40:07.000Z","size":132,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-06T05:39:40.287Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Guseyn.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-06-08T14:01:21.000Z","updated_at":"2019-05-10T21:40:09.000Z","dependencies_parsed_at":"2022-08-20T17:11:03.280Z","dependency_job_id":null,"html_url":"https://github.com/Guseyn/cutie-cluster","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Guseyn/cutie-cluster","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guseyn%2Fcutie-cluster","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guseyn%2Fcutie-cluster/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guseyn%2Fcutie-cluster/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guseyn%2Fcutie-cluster/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Guseyn","download_url":"https://codeload.github.com/Guseyn/cutie-cluster/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Guseyn%2Fcutie-cluster/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260072555,"owners_count":22954914,"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":"2025-06-06T05:39:38.742Z","updated_at":"2025-06-16T00:06:54.862Z","avatar_url":"https://github.com/Guseyn.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cutie-cluster\n\n[![NPM Version](https://img.shields.io/npm/v/@cuties/cluster.svg)](https://npmjs.org/package/@cuties/cluster)\n[![Build Status](https://travis-ci.org/Guseyn/cutie-cluster.svg?branch=master)](https://travis-ci.org/Guseyn/cutie-cluster)\n[![codecov](https://codecov.io/gh/Guseyn/cutie-cluster/branch/master/graph/badge.svg)](https://codecov.io/gh/Guseyn/cutie-cluster)\n\n[Cutie](https://github.com/Guseyn/cutie) extension for \u003cb\u003ecluster\u003c/b\u003e module in Node. It's based on the [Async Tree Pattern](https://github.com/Guseyn/async-tree-patern/blob/master/Async_Tree_Patern.pdf).\n\n\n## Examples\n\nYou can find examples of using this library in the [test directory](https://github.com/Guseyn/cutie-cluster/tree/master/test).\n\n## Install\n\n`npm install @cuties/cluster`\n\n## Run test\n\n`npm test`\n\n## Run build\n\n`npm run build`\n\n## Usage\n\n```js\nconst {\n  // Needed async objects here from the table below\n} = require('@cuties/cluster');\n```\nFor more information about parameters in the async objects visit [docs of Node](https://nodejs.org/en/docs/) for \u003cb\u003ecluster\u003c/b\u003e module.\n\n## cluster\n\n| Async Object  | Async/sync call | Parameters(default value/description) | Representation result |\n| ------------- | ----------------| ---------- | --------------------- |\n| `ClusterWithDisconnectEvent` | `cluster.on('disconnect', event)` | `cluster, event (Event with definedBody(worker))` | `cluster` |\n| `ClusterWithExitEvent` | `cluster.on('exit', event)` | `cluster, event (Event with definedBody(worker, code, signal))` | `cluster` |\n| `ClusterWithForkedWorkers` | `for (let i = 0; i \u003c num; i++) {cluster.fork(env);}` | `cluster, num(number of workers), env` | `cluster` |\n| `ClusterWithForkEvent` | `cluster.on('fork', event)` | `cluster, event (Event with definedBody(worker))` | `cluster` |\n| `ClusterWithListeningEvent` | `cluster.on('listening', event)` | `cluster, event (Event with definedBody(worker, address))` | `cluster` |\n| `ClusterWithMessageEvent` | `cluster.on('message', event)` | `cluster, event (Event with definedBody(worker, message, handle))` | `cluster` |\n| `ClusterWithOnlineEvent` | `cluster.on('online', event)` | `cluster, event (Event with definedBody(worker))` | `cluster` |\n| `HasWorkers` | `Object.keys(cluster.workers) \u003e 0` | `cluster` | `boolean` |\n\n## worker\n\n| Async Object  | Async/sync call | Parameters(default value/description) | Representation result |\n| ------------- | ----------------| ---------- | --------------------- |\n| `DisconnectedWorker` | `worker.disconnect` | `worker` | `worker` |\n| `ForkedWorker` | `cluster.fork` | `cluster, env` | `worker` |\n| `IsConnected` | `worker.isConnected` | `worker` | `boolean` |\n| `IsDead` | `worker.isDead` | `worker` | `boolean` |\n| `IsExitedAfterDisconnect` | `worker.exitedAfterDisconnect` | `worker` | `boolean` |\n| `KilledWorker` | `worker.kill` | `worker, signal('SIGTERM')` | `worker` |\n| `SentMessage` | `worker.send` | `worker, message[, sendHandle][, callback]` | `message(string)` |\n| `Worker` | `cluster.worker` | `cluster` | `worker` |\n| `WorkerId` | `worker.id` | `worker` | `number` |\n| `WorkerProcess` | `worker.process` | `worker` | `process` |\n| `Workers` | `cluster.workers` | `cluster` | `object` |\n| `WorkerWithDisconnectEvent` | `worker.on('disconnect', event)` | `worker, event(Event with definedBody())` | `worker` |\n| `WorkerWithErrorEvent` | `worker.on('error', event)` | `worker, event(Event with definedBody(error))` | `worker` |\n| `WorkerWithExitEvent` | `worker.on('exit', event)` | `worker, event(Event with definedBody(code, signal))` | `worker` |\n| `WorkerWithListeningEvent` | `worker.on('listening', event)` | `worker, event(Event with definedBody(address))` | `worker` |\n| `WorkerWithMessageEvent` | `worker.on('message', event)` | `worker, event(Event with definedBody(msg))` | `worker` |\n| `WorkerWithOnlineEvent` | `worker.on('online', event)` | `worker, event (Event with definedBody())` | `worker` |\n\n## common\n\n| Async Object  | Async/sync call | Parameters(default value/description) | Representation result |\n| ------------- | ----------------| ---------- | --------------------- |\n| `IsMaster` | `cluster.isMaster` | `cluster` | `boolean` |\n| `IsWorker` | `cluster.isWorker` | `cluster` | `boolean` |\n| `SchedulingPolicy` | `cluster.schedulingPolicy` | `cluster` | `number` |\n| `Settings` | `cluster.settings` | `cluster` | `object` |\n| `SetupMaster` | `cluster` | `cluster, settings` | `process` |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguseyn%2Fcutie-cluster","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguseyn%2Fcutie-cluster","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguseyn%2Fcutie-cluster/lists"}