Skip to content

Commit 161550b

Browse files
authored
Update example 63 to support v1.0.0+
Add LoopInterface as first constructor argument to Server and change Server to accept variadic middleware handlers instead of array.
1 parent badb0a8 commit 161550b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/63-server-streaming-request.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
// Note how this example uses the advanced `StreamingRequestMiddleware` to allow streaming
1010
// the incoming HTTP request. This very simple example merely counts the size
1111
// of the streaming body, it does not otherwise buffer its contents in memory.
12-
$server = new React\Http\Server(array(
12+
$server = new React\Http\Server(
13+
$loop,
1314
new React\Http\Middleware\StreamingRequestMiddleware(),
1415
function (Psr\Http\Message\ServerRequestInterface $request) {
1516
$body = $request->getBody();
@@ -44,7 +45,7 @@ function (Psr\Http\Message\ServerRequestInterface $request) {
4445
});
4546
});
4647
}
47-
));
48+
);
4849

4950
$server->on('error', 'printf');
5051

0 commit comments

Comments
 (0)