Skip to content

Commit

Permalink
doc: update React-related documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
bpolaszek committed Nov 29, 2023
1 parent ade9f45 commit da3307b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Table of Contents
- [Chaining extractors / transformers / loaders](doc/advanced_usage.md#chaining-extractors--transformers--loaders)
- [Reading from STDIN / Writing to STDOUT](doc/advanced_usage.md#reading-from-stdin--writing-to-stdout)
- [Instantiators](doc/advanced_usage.md#instantiators)
- [Using React Streams (ReactPHP support)](doc/advanced_usage.md#using-react-streams-experimental)
- [Using ReactPHP](doc/advanced_usage.md#using-reactphp-experimental)
- [Recipes](doc/recipes.md)
- [Contributing](#contribute)
- [License](#license)
Expand Down
12 changes: 10 additions & 2 deletions doc/advanced_usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,18 @@ $report = withRecipe(new LoggerRecipe($logger))
->process(['foo', 'bar']);
```

Using React streams (experimental)
Using ReactPHP (experimental)
----------------------------------

You can plug your ETL dataflows to any [React Stream](https://github.com/reactphp/stream).
By using the `ReactStreamProcessor` recipe, you can use ReactPHP as the processor of your data.

You can use any [React Stream](https://github.com/reactphp/stream) or `iterable`: each item will be iterated
using a [Loop tick](https://github.com/reactphp/event-loop#futuretick) instead of a blocking `while` loop.

This allows you, for example, to:
- [Periodically](https://github.com/reactphp/event-loop#addperiodictimer) perform some stuff (with `Loop::addPeriodicTimer()`)
- Handle [POSIX signals](https://github.com/reactphp/event-loop#addsignal) (with `Loop::addSignal()`)
- Use [React streams](https://github.com/reactphp/stream) for an event-oriented approach.

Example with a TCP server:

Expand Down

0 comments on commit da3307b

Please sign in to comment.