-
Notifications
You must be signed in to change notification settings - Fork 53
feat: log cluster module IPC via onelogger #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e15a4bf
aa3034f
b74872c
3304051
4d1c26f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "extends": "eslint-config-egg", | ||
| "parserOptions": { | ||
| "ecmaVersion": 13 | ||
| } | ||
| "extends": [ | ||
| "eslint-config-egg/typescript", | ||
| "eslint-config-egg/lib/rules/enforce-node-prefix" | ||
| ] | ||
| } |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| name: Publish Any Commit | ||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - run: corepack enable | ||
| - uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 20 | ||
|
|
||
| - name: Install dependencies | ||
| run: npm install | ||
|
|
||
| - name: Build | ||
| run: npm run prepublishOnly --if-present | ||
|
|
||
| - run: npx pkg-pr-new publish |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,3 +9,7 @@ run | |
| .nyc_output | ||
| package-lock.json | ||
| .package-lock.json | ||
| .tshy* | ||
| .eslintcache | ||
| dist | ||
| coverage | ||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,48 +1,62 @@ | ||||||||||
| # egg-cluster | ||||||||||
|
|
||||||||||
| [![NPM version][npm-image]][npm-url] | ||||||||||
| [](https://github.com/eggjs/egg-cluster/actions/workflows/nodejs.yml) | ||||||||||
| [](https://github.com/eggjs/cluster/actions/workflows/nodejs.yml) | ||||||||||
| [![Test coverage][codecov-image]][codecov-url] | ||||||||||
| [![Known Vulnerabilities][snyk-image]][snyk-url] | ||||||||||
| [![npm download][download-image]][download-url] | ||||||||||
| [](https://nodejs.org/en/download/) | ||||||||||
|
|
||||||||||
| [npm-image]: https://img.shields.io/npm/v/egg-cluster.svg?style=flat-square | ||||||||||
| [npm-url]: https://npmjs.org/package/egg-cluster | ||||||||||
| [codecov-image]: https://codecov.io/github/eggjs/egg-cluster/coverage.svg?branch=master | ||||||||||
| [codecov-url]: https://codecov.io/github/eggjs/egg-cluster?branch=master | ||||||||||
| [snyk-image]: https://snyk.io/test/npm/egg-cluster/badge.svg?style=flat-square | ||||||||||
| [snyk-url]: https://snyk.io/test/npm/egg-cluster | ||||||||||
| [download-image]: https://img.shields.io/npm/dm/egg-cluster.svg?style=flat-square | ||||||||||
| [download-url]: https://npmjs.org/package/egg-cluster | ||||||||||
| [npm-image]: https://img.shields.io/npm/v/@eggjs/cluster.svg?style=flat-square | ||||||||||
| [npm-url]: https://npmjs.org/package/@eggjs/cluster | ||||||||||
| [codecov-image]: https://codecov.io/github/eggjs/cluster/coverage.svg?branch=master | ||||||||||
| [codecov-url]: https://codecov.io/github/eggjs/cluster?branch=master | ||||||||||
| [snyk-image]: https://snyk.io/test/npm/@eggjs/cluster/badge.svg?style=flat-square | ||||||||||
| [snyk-url]: https://snyk.io/test/npm/@eggjs/cluster | ||||||||||
| [download-image]: https://img.shields.io/npm/dm/@eggjs/cluster.svg?style=flat-square | ||||||||||
| [download-url]: https://npmjs.org/package/@eggjs/cluster | ||||||||||
|
|
||||||||||
| Cluster Manager for EggJS | ||||||||||
|
|
||||||||||
| --- | ||||||||||
|
|
||||||||||
| ## Install | ||||||||||
|
|
||||||||||
| ```bash | ||||||||||
| npm i egg-cluster --save | ||||||||||
| npm i @eggjs/cluster | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Usage | ||||||||||
|
|
||||||||||
| CommonJS | ||||||||||
|
|
||||||||||
| ```js | ||||||||||
| const startCluster = require('egg-cluster').startCluster; | ||||||||||
| const { startCluster } = require('@eggjs/cluster'); | ||||||||||
|
|
||||||||||
| startCluster({ | ||||||||||
| baseDir: '/path/to/app', | ||||||||||
| framework: '/path/to/framework', | ||||||||||
| }); | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| You can specify a callback that will be invoked when application has started. However, master process will exit when catch an error. | ||||||||||
| You can specify a callback that will be invoked when application has started. | ||||||||||
| However, master process will exit when catch an error. | ||||||||||
|
Comment on lines
+40
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Clarify Promise wording in startup description. Current text says “callback” and has awkward grammar; this section reads clearer if it explicitly describes Promise-based completion/error handling. Suggested wording-You can specify a callback that will be invoked when application has started.
-However, master process will exit when catch an error.
+You can handle startup completion from the returned Promise.
+The master process exits if startup throws an error.📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||
|
|
||||||||||
| ```js | ||||||||||
| startCluster(options, () => { | ||||||||||
| startCluster(options).then(() => { | ||||||||||
| console.log('started'); | ||||||||||
| }); | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ESM and TypeScript | ||||||||||
|
|
||||||||||
| ```ts | ||||||||||
| import { startCluster } from '@eggjs/cluster'; | ||||||||||
|
|
||||||||||
| startCluster({ | ||||||||||
| baseDir: '/path/to/app', | ||||||||||
| framework: '/path/to/framework', | ||||||||||
| }); | ||||||||||
| ``` | ||||||||||
|
|
||||||||||
| ## Options | ||||||||||
|
|
||||||||||
| | Param | Type | Description | | ||||||||||
|
|
@@ -63,16 +77,16 @@ startCluster(options, () => { | |||||||||
|
|
||||||||||
| ## Env | ||||||||||
|
|
||||||||||
| EGG_APP_CLOSE_TIMEOUT: app worker boot timeout value | ||||||||||
| `EGG_APP_CLOSE_TIMEOUT`: app worker boot timeout value | ||||||||||
|
|
||||||||||
| EGG_AGENT_CLOSE_TIMEOUT: agent worker boot timeout value | ||||||||||
| `EGG_AGENT_CLOSE_TIMEOUT`: agent worker boot timeout value | ||||||||||
|
|
||||||||||
| ## License | ||||||||||
|
|
||||||||||
| [MIT](LICENSE) | ||||||||||
|
|
||||||||||
| ## Contributors | ||||||||||
|
|
||||||||||
| [](https://github.com/eggjs/egg-cluster/graphs/contributors) | ||||||||||
| [](https://github.com/eggjs/cluster/graphs/contributors) | ||||||||||
|
|
||||||||||
| Made with [contributors-img](https://contrib.rocks). | ||||||||||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trim the auto-generated summary block from the changelog.
This section is very verbose and includes beta-oriented wording inside final release notes, which can make the changelog harder to trust/scan.
Suggested cleanup
🧰 Tools
🪛 LanguageTool
[grammar] ~30-~30: Use a hyphen to join words.
Context: ...ess management. - Introduced new error handling classes for better debugging. ...
(QB_NEW_EN_HYPHEN)
🤖 Prompt for AI Agents