nitpick
This commit is contained in:
parent
f86b9b52ee
commit
6496d56b55
|
|
@ -42,6 +42,25 @@ class StartWebSocketServer extends Command
|
||||||
->startWebSocketServer();
|
->startWebSocketServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function configureStatisticsLogger()
|
||||||
|
{
|
||||||
|
$handler = new HttpClientAdapter($this->loop);
|
||||||
|
|
||||||
|
$client = new Client([
|
||||||
|
'handler' => HandlerStack::create($handler),
|
||||||
|
]);
|
||||||
|
|
||||||
|
app()->singleton('websockets.statisticslogger', function() use ($client) {
|
||||||
|
return new StatisticsLogger(app(ChannelManager::class, $client));
|
||||||
|
});
|
||||||
|
|
||||||
|
$this->loop->addPeriodicTimer(60, function() {
|
||||||
|
StatisticsLogger::save($this->loop);
|
||||||
|
});
|
||||||
|
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
|
|
||||||
protected function configureHttpLogger()
|
protected function configureHttpLogger()
|
||||||
{
|
{
|
||||||
app()->singleton(HttpLogger::class, function() {
|
app()->singleton(HttpLogger::class, function() {
|
||||||
|
|
@ -75,25 +94,6 @@ class StartWebSocketServer extends Command
|
||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function configureStatisticsLogger()
|
|
||||||
{
|
|
||||||
$handler = new HttpClientAdapter($this->loop);
|
|
||||||
|
|
||||||
$client = new Client([
|
|
||||||
'handler' => HandlerStack::create($handler),
|
|
||||||
]);
|
|
||||||
|
|
||||||
app()->singleton('websockets.statisticslogger', function() use ($client) {
|
|
||||||
return new StatisticsLogger(app(ChannelManager::class, $client));
|
|
||||||
});
|
|
||||||
|
|
||||||
$this->loop->addPeriodicTimer(60, function() {
|
|
||||||
StatisticsLogger::save($this->loop);
|
|
||||||
});
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
protected function registerEchoRoutes()
|
protected function registerEchoRoutes()
|
||||||
{
|
{
|
||||||
WebSocketsRouter::echo();
|
WebSocketsRouter::echo();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue