mirror of
https://github.com/bitinflow/expose.git
synced 2026-03-16 06:55:56 +00:00
wip
This commit is contained in:
@@ -96,12 +96,15 @@ class Client
|
|||||||
});
|
});
|
||||||
|
|
||||||
$connection->on('setMaximumConnectionLength', function ($data) {
|
$connection->on('setMaximumConnectionLength', function ($data) {
|
||||||
$this->loop->addPeriodicTimer(1, function() use ($data) {
|
$timeoutSection = $this->logger->getOutput()->section();
|
||||||
|
|
||||||
|
$this->loop->addPeriodicTimer(1, function() use ($data, $timeoutSection) {
|
||||||
$this->timeConnected++;
|
$this->timeConnected++;
|
||||||
|
|
||||||
$carbon = Carbon::createFromFormat('s', str_pad($data->length * 60 - $this->timeConnected, 2, 0, STR_PAD_LEFT));
|
$carbon = Carbon::createFromFormat('s', str_pad($data->length * 60 - $this->timeConnected, 2, 0, STR_PAD_LEFT));
|
||||||
|
|
||||||
$this->logger->info('Remaining time: '.$carbon->format('H:i:s'));
|
$timeoutSection->clear();
|
||||||
|
$timeoutSection->writeln('Remaining time: '.$carbon->format('H:i:s'));
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -30,6 +30,14 @@ class CliRequestLogger extends Logger
|
|||||||
$this->requests = new Collection();
|
$this->requests = new Collection();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return ConsoleOutputInterface
|
||||||
|
*/
|
||||||
|
public function getOutput()
|
||||||
|
{
|
||||||
|
return $this->output;
|
||||||
|
}
|
||||||
|
|
||||||
public function logRequest(LoggedRequest $loggedRequest)
|
public function logRequest(LoggedRequest $loggedRequest)
|
||||||
{
|
{
|
||||||
if ($this->requests->has($loggedRequest->id())) {
|
if ($this->requests->has($loggedRequest->id())) {
|
||||||
|
|||||||
@@ -37,7 +37,9 @@ class ControlConnection
|
|||||||
{
|
{
|
||||||
$this->socket->send(json_encode([
|
$this->socket->send(json_encode([
|
||||||
'event' => 'setMaximumConnectionLength',
|
'event' => 'setMaximumConnectionLength',
|
||||||
'length' => $maximumConnectionLength,
|
'data' => [
|
||||||
|
'length' => $maximumConnectionLength,
|
||||||
|
],
|
||||||
]));
|
]));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user