Skip to content

Commit

Permalink
Add parallel_fork docs
Browse files Browse the repository at this point in the history
  • Loading branch information
eisuke committed Apr 5, 2017
1 parent 2484132 commit d21132c
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
17 changes: 17 additions & 0 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,23 @@ fork:
execute: say -v "Victoria"" "I'm Victoria"
```

## parallel_fork

`parallel_fork` task applies its child branches the specified number of times in parallel,
and adds the enviroment value `KUROKO2_PARALLEL_FORK_INDEX` and `KUROKO2_PARALLEL_FORK_SIZE` automatically.

**Option**

A number of parallel size.

**Example**

```
parallel_fork: 5
execute: sleep $KUROKO2_PARALLEL_INDEX
execute: echo $KUROKO2_PARALLEL_FORK_INDEX $KUROKO2_PARALLEL_FORK_SIZE
```

## noop

`noop` does nothing. This is a task for test purpose.
Expand Down
2 changes: 1 addition & 1 deletion lib/autoload/kuroko2/workflow/task/parallel_fork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module Kuroko2
module Workflow
module Task
class ParallelFork < Fork
def vallidate
def validate
super
raise Workflow::AssertionError, "ParallelFork must have a parallel size (Int)" unless option.present? && option.match(/\A\d+\z/)
end
Expand Down

0 comments on commit d21132c

Please sign in to comment.