5
I wonder what the Reactphp. I couldn’t find any material explaining what it is and what its goal is.
I’d like to know what it’s for and if it’s worth using.
5
I wonder what the Reactphp. I couldn’t find any material explaining what it is and what its goal is.
I’d like to know what it’s for and if it’s worth using.
3
Reactphp is a low-level library for PHP event-oriented programming.
At its core is an event loop, upon which it provides low-level utilities such as: stream abstraction, asynchronous DNS resolution, client / network server, client / http server, process interaction.
Third-party libraries can use these components to create clients / asynchronous network servers and more.
Example of use:
require 'vendor/autoload.php';
$app = function ($request, $response) {
$response->writeHead(200, array('Content-Type' => 'text/plain'));
$response->end("Hello World\n");
};
$loop = React\EventLoop\Factory::create();
$socket = new React\Socket\Server($loop);
$http = new React\Http\Server($socket, $loop);
$http->on('request', $app);
echo "Server running at http://127.0.0.1:1337\n";
$socket->listen(1337);
$loop->run();
See also: http://reactphp.org/
Browser other questions tagged php
You are not signed in. Login or sign up in order to post.
That reply was received in connection with your reply: http://stackoverflow.com/a/24067776/1432957
– Marcelo de Andrade