Permalink
Browse files

[docs] Update docs to indicate that the pid is now returned.

  • Loading branch information...
1 parent 4201dba commit 744a7c7d52240c2108d08ed0b9c2e16123a7ce9a @AvianFlu committed May 17, 2012
Showing with 7 additions and 3 deletions.
  1. +7 −3 README.md
View
@@ -58,13 +58,15 @@ application logic starts.
var http = require('http'),
prefork = require('prefork');
-prefork();
+var pid = prefork();
http.createServer(function (req, res) {
- res.end('I am a backgrounded HTTP server.');
+ res.end('I am a backgrounded HTTP server, running as ' + pid);
}).listen(8080);
```
+`prefork()` will perform all necessary actions to background your process, and
+return the new `pid`.
### stdio redirection
@@ -74,10 +76,12 @@ To simply log all output to a file:
```js
-prefork({
+var pid = prefork({
stdout: 'output.log'
});
+console.log('Started successfully, new pid is %d', pid);
+
```
If only `stdout` is provided, `stderr` will be redirected to the same place.

0 comments on commit 744a7c7

Please sign in to comment.