8000 Simplify usage by supporting new default loop by clue · Pull Request #445 · reactphp/reactphp · GitHub
[go: up one dir, main page]

Skip to content

Simplify usage by supporting new default loop #445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 11, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@ Streams abstraction, async DNS resolver, network client/server, HTTP
client/server and interaction with processes. Third-party libraries can use these
components to create async network clients/servers and more.

```php
$server = new React\Http\Server(function (Psr\Http\Message\ServerRequestInterface $request) {
return new React\Http\Message\Response(
200,
array(
'Content-Type' => 'text/plain'
),
"Hello World!\n"
);
});

$socket = new React\Socket\Server('127.0.0.1:8080');
$server->listen($socket);

echo "Server running at http://127.0.0.1:8080" . PHP_EOL;
```

This simple web server written in ReactPHP responds with "Hello World!" for every request.

ReactPHP is production ready and battle-tested with millions of installations
from all kinds of projects around the world. Its event-driven architecture makes
it a perfect fit for efficient network servers and clients handling hundreds or
Expand Down
12 changes: 6 additions & 6 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@
"require": {
"php": ">=5.3.8",
"react/cache": "^1.0",
"react/dns": "^1.3",
"react/event-loop": "^1.0",
"react/http": "^1.0",
"react/dns": "^1.8",
"react/event-loop": "^1.2",
"react/http": "^1.4",
"react/promise": "^2.1 || ^1.2",
"react/promise-stream": "^1.1.1",
"react/promise-timer": "^1.6",
"react/socket": "^1.4",
"react/stream": "^1.0"
"react/promise-timer": "^1.7",
"react/socket": "^1.8",
"react/stream": "^1.2"
},
"require-dev": {
"clue/block-react": "^1.1",
Expand Down
6 changes: 2 additions & 4 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,8 @@
<testsuites>
<testsuite name="ReactPHP Test Suite">
<directory>./vendor/react/*/tests/</directory>
<!-- temporarily skip broken tests, see https://github.com/reactphp/dns/pull/164 -->
<exclude>./vendor/react/dns/tests/FunctionalResolverTest.php</exclude>
<exclude>./vendor/react/dns/tests/Query/CoopExecutorTest.php</exclude>
<exclude>./vendor/react/dns/tests/Query/SelectiveTransportExecutorTest.php</exclude>
<!-- temporarily skip broken und unneeded tests, see https://github.com/reactphp/event-loop/pull/232 -->
<exclude>./vendor/react/event-loop/tests/BinTest.php</exclude>
</testsuite>
</testsuites>

Expand Down
0