2.2.1 • Published 5 months ago

egg-cluster v2.2.1

Weekly downloads
22,958
License
MIT
Repository
github
Last release
5 months ago

egg-cluster

NPM version CI Test coverage Known Vulnerabilities npm download

Cluster Manager for EggJS


Install

npm i egg-cluster --save

Usage

const startCluster = require('egg-cluster').startCluster;
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.

startCluster(options, () => {
  console.log('started');
});

Options

ParamTypeDescription
baseDirStringdirectory of application
frameworkStringspecify framework that can be absolute path or npm package
pluginsObjectplugins for unittest
workersNumbernumbers of app workers
stickyBooleansticky mode server
portNumberport
debugPortNumberthe debug port only listen on http protocol
httpsObjectstart a https server, note: key / cert / ca should be full path to file
requireArray\|Stringwill inject into worker/agent process
pidFileStringwill save master pid to this file
startModeStringdefault is 'process', use 'worker_threads' to start the app & agent worker by worker_threads
portsArraystartup port of each app worker, such as: 7001, 7002, 7003, only effects when the startMode is 'worker_threads'
envStringcustom env, default is process.env.EGG_SERVER_ENV

Env

EGG_APP_CLOSE_TIMEOUT: app worker boot timeout value

EGG_AGENT_CLOSE_TIMEOUT: agent worker boot timeout value

License

MIT

2.2.1

5 months ago

2.2.0

10 months ago

2.1.1

11 months ago

2.1.0

11 months ago

2.0.1

1 year ago

2.0.0

1 year ago

1.27.1

2 years ago

1.27.0

3 years ago

1.26.0

4 years ago

1.25.0

5 years ago

1.24.0

5 years ago

1.23.3

5 years ago

1.23.2

5 years ago

1.23.1

5 years ago

1.23.0

5 years ago

1.22.2

5 years ago

1.22.1

6 years ago

1.22.0

6 years ago

1.21.0

6 years ago

1.20.0

6 years ago

1.19.1

6 years ago

1.19.0

6 years ago

1.18.0

6 years ago

1.17.0

6 years ago

1.16.1

6 years ago

1.16.0

6 years ago

1.15.0

6 years ago

1.14.0

6 years ago

1.13.1

6 years ago

1.13.0

6 years ago

1.12.6

6 years ago

1.12.5

6 years ago

1.12.4

7 years ago

1.12.3

7 years ago

1.12.2

7 years ago

1.12.1

7 years ago

1.12.0

7 years ago

1.11.2

7 years ago

1.11.1

7 years ago

1.11.0

7 years ago

1.10.0

7 years ago

1.9.2

7 years ago

1.9.1

7 years ago

1.9.0

7 years ago

1.8.0

7 years ago

1.7.0

7 years ago

1.6.4

7 years ago

1.6.3

7 years ago

1.6.2

7 years ago

1.6.1

7 years ago

1.6.0

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.0

8 years ago

0.2.0

8 years ago

0.1.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago