Skip to content

Commit 7219921

Browse files
committed
Update example in the readme
It's been lagging behind and the possibilities significantly changed and more importantly improved. (And so did the constructor signature!)
1 parent 99107fa commit 7219921

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,19 @@ The middleware adapter accepts any PSR-15 middleware instance that meets for fol
2323
* Doesn't have internal state or relies on external state
2424

2525
```php
26+
use ReactParallel\Factory as ParallelFactory;
27+
2628
$loop = Factory::create();
27-
$pool = new Infinite($loop, 10);
28-
$eventLoopBridge = new EventLoopBridge($loop);
29-
$streamFactory = new StreamFactory($eventLoopBridge);
29+
$factory = new ParallelFactory($loop);
3030
$psr15Middleware = new ThePsr15MiddlewareOfYourChoice();
31+
$otherPsr15Middleware = new TheOtherPsr15MiddlewareOfYourChoice();
3132
$server = new React\Http\Server(
3233
$loop,
33-
new ReactMiddleware($streamFactory, $pool, $psr15Middleware, $loop, $eventLoopBridge)
34+
new ReactMiddleware(
35+
$factory,
36+
$psr15Middleware,
37+
$otherPsr15Middleware
38+
)
3439
);
3540
```
3641

0 commit comments

Comments
 (0)