Skip to content

Commit

Permalink
Revise passing state documentation
Browse files Browse the repository at this point in the history
Update the alternative approach to using returned results to be more inline with the suggestions proposed here:
consolidation#382

Using the Symfony Process component for returning simple system info.
  • Loading branch information
justinlevi committed Nov 27, 2018
1 parent a2b3bf6 commit 1e716c5
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion docs/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,19 @@ More complex task configuration may be done via the `defer()` method. `defer()`
->run();
?>
```
In general, it is preferable to collect all of the information needed first, and then use that data to configure the necessary tasks. For example, the previous example could be implemented more simply by calling `$system_name = exec('uname -n');` and `taskFilesystemStack->mkdir($system_name);`. Chained state can be helpful in instances where there is a more complex relationship between the tasks.

In general, it is preferable to collect all of the information needed first, and then use that data to configure the necessary tasks. For example, the previous example could be implemented insead by using Symfony Process component directly.

```
$process = new Symfony\Component\Process\Process('uname -n');
$process->start();
$process->wait();
$system_name = $process->getOutput();
taskFileSystemStack->mkdir($system_name);
```

Chained state can be helpful in instances where there is a more complex relationship between the tasks.

## Named Tasks

Expand Down

0 comments on commit 1e716c5

Please sign in to comment.