Skip to content

Commit

Permalink
Upgrade react/http (#813)
Browse files Browse the repository at this point in the history
  • Loading branch information
andig authored Jul 27, 2020
1 parent 599cd13 commit e99faab
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion bin/push-server
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ $middleware = new MiddlewareAdapter();

// configure local httpd interface
$localSocket = new SocketServer(REMOTE_IP_PORT . $localPort, $loop); // remote loggers can push updates
$localServer = new HttpReceiver($localSocket, $middleware);
$localServer = new HttpReceiver($loop, $localSocket, $middleware);

// configure routes
$routes = new RouteCollection;
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"symfony/routing": "^4.0",
"symfony/yaml": "^4.0",
"cboden/ratchet": "^0.4",
"react/http": "^0.8",
"react/http": "^1.0",
"ringcentral/psr7": "^1.2",
"php-pm/php-pm": "^2.0",
"php-pm/httpkernel-adapter": "^2.0",
Expand Down
5 changes: 3 additions & 2 deletions lib/Server/HttpReceiver.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

namespace Volkszaehler\Server;

use React\EventLoop\LoopInterface;
use React\Socket\Server as SocketServer;
use React\Http\Server as HttpServer;
use Psr\Http\Message\ResponseInterface;
Expand All @@ -44,10 +45,10 @@ class HttpReceiver {
*/
protected $http;

function __construct(SocketServer $socket, MiddlewareAdapter $hub) {
function __construct(LoopInterface $loop, SocketServer $socket, MiddlewareAdapter $hub) {
$this->hub = $hub;

$this->http = new HttpServer([$this, 'handleRequest']);
$this->http = new HttpServer($loop, [$this, 'handleRequest']);
$this->http->listen($socket);
}

Expand Down

0 comments on commit e99faab

Please sign in to comment.