clue · GitHub

Conversation

@legionth

try {
$callback($request, $response);
} catch (\Exception $ex) {
$this->emit('error', array());
$server->on('request', $this->expectCallableOnce());
$countCalled = 0;

$callback = function ($request, $response) use (&$countCalled) {

clue

clue approved these changes Feb 9, 2017

@legionth

clue


For each incoming connection, it emits a `request` event with the respective
For each incoming connection, it executes the callback function with the respective
[`Request`](#request) and [`Response`](#response) objects:

@legionth

clue


The `Server` class is responsible for handling incoming connections and then
emit a `request` event for each incoming HTTP request.
execute the execute the callback function passed to the constructor.
as HTTP.

For each incoming connection, it executes the callback function with the
respective [`Request`](#request) and [`Response`](#response) objects:
$socket = new React\Socket\Server(8080, $loop);

$http = new React\Http\Server($socket);
$http = new React\Http\Server($socket, function (Request $request, Response $response) {
public function __construct(SocketServerInterface $io, $callback)
{
if (!is_callable($callback)) {
throw new InvalidArgumentException();

@legionth

@legionth

WyriHaximus

clue

clue approved these changes Mar 15, 2017

jsor

jsor approved these changes Mar 16, 2017

@clue

Merged

@clue clue mentioned this pull request

May 28, 2017

Merged

Read the original on github.com ↗