Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Moar docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Jan 21, 2017
1 parent 7da2f02 commit 32f76bc
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Options
-d, --delay [default=1000ms] Waiting time between spawning workers.
-r, --retries [default=Infinity] Max number of call requeues after unexpected worker termination.
-r, --retries [default=Infinity] Max number of call requeues after unexpected worker termination.
It's possible to load [options] from file, creating '.farm' JSON file on the path of <file>.
Expand Down
2 changes: 1 addition & 1 deletion bin/cli/help.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Options

-d, --delay [default=1000ms] Waiting time between spawning workers.

-r, --retries [default=Infinity] Max number of call requeues after unexpected worker termination.
-r, --retries [default=Infinity] Max number of call requeues after unexpected worker termination.

It's possible to load [options] from file, creating '.farm' JSON file on the path of <file>.

Expand Down
4 changes: 4 additions & 0 deletions example/load-config/.farm
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"maxConcurrentWorkers" : 1,
"delay": 5000
}
5 changes: 5 additions & 0 deletions example/load-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Basic

```bash
$ DEBUG=worker-farm-cli worker-farm -w 2 -n 5 -d 0 example/basic --your-file-flags foo=bar
```
3 changes: 3 additions & 0 deletions example/load-config/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
'use strict'

module.exports = function (opts) {}
7 changes: 7 additions & 0 deletions example/throw-error/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# throw-error

If the process throw an error, then the child worker will spawned again.

```bash
$ DEBUG=worker-farm-cli worker-farm -w 1 -n 1 -d 0 example/throw-error --your-file-flags foo=bar
```
5 changes: 5 additions & 0 deletions example/throw-error/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
'use strict'

module.exports = function (opts, cb) {
throw new Error('Something bad happens')
}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"version": "1.3.3",
"main": "bin",
"bin": {
"farm": "bin/cli/index.js"
"worker-farm": "bin/cli/index.js"
},
"author": {
"email": "josefrancisco.verdu@gmail.com",
Expand Down

0 comments on commit 32f76bc

Please # to comment.