From 0c5d6416db02569e2ac70af14e69d31db2c0b386 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Sun, 28 Oct 2018 09:23:50 +0800 Subject: [PATCH 1/3] doc: make example more clarified in cluster.md --- doc/api/cluster.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index d1a4fa395e4e96..8674a97bd04f6c 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -199,7 +199,10 @@ Within a worker, `process.on('message')` may also be used. See [`process` event: `'message'`][]. As an example, here is a cluster that keeps count of the number of requests -in the master process using the message system: +in the master process using the message system. + +Note that when this example running, you need to open browser and visit `http://localhost:8000` +or open another terminal window and run `curl http://localhost:8000` to see `numReqs` increasing. ```js const cluster = require('cluster'); From 987efb53e622e1df2dfcd543f0554a9942ab7967 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Sun, 28 Oct 2018 10:09:14 +0800 Subject: [PATCH 2/3] doc: update example explanation --- doc/api/cluster.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 8674a97bd04f6c..27a72ecf353852 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -198,8 +198,8 @@ Within a worker, `process.on('message')` may also be used. See [`process` event: `'message'`][]. -As an example, here is a cluster that keeps count of the number of requests -in the master process using the message system. +Here is an example using the message system. It keeps a count in the master +process of the number of HTTP requests received by the workers: Note that when this example running, you need to open browser and visit `http://localhost:8000` or open another terminal window and run `curl http://localhost:8000` to see `numReqs` increasing. From bf9e1ea99225c650bfbc0de805b51e5e74fb9a00 Mon Sep 17 00:00:00 2001 From: ZYSzys <17367077526@163.com> Date: Sun, 28 Oct 2018 11:33:47 +0800 Subject: [PATCH 3/3] doc: update example in cluster.md --- doc/api/cluster.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/api/cluster.md b/doc/api/cluster.md index 27a72ecf353852..a053a4d31a82a1 100644 --- a/doc/api/cluster.md +++ b/doc/api/cluster.md @@ -201,9 +201,6 @@ See [`process` event: `'message'`][]. Here is an example using the message system. It keeps a count in the master process of the number of HTTP requests received by the workers: -Note that when this example running, you need to open browser and visit `http://localhost:8000` -or open another terminal window and run `curl http://localhost:8000` to see `numReqs` increasing. - ```js const cluster = require('cluster'); const http = require('http');