mirror of
https://github.com/danog/TelegramApiServer.git
synced 2024-11-26 20:04:45 +01:00
websocket-events add reconection loop.
This commit is contained in:
parent
2a1e2aeada
commit
9acd4e6c33
@ -23,6 +23,7 @@ $options = [
|
||||
Amp\Loop::run(static function () use($options) {
|
||||
echo "Connecting to: {$options['url']}" . PHP_EOL;
|
||||
|
||||
while(true) {
|
||||
try {
|
||||
/** @var Connection $connection */
|
||||
$connection = yield connect($options['url']);
|
||||
@ -40,5 +41,7 @@ Amp\Loop::run(static function () use($options) {
|
||||
} catch (\Throwable $e) {
|
||||
printf("Error: %s\n", $e->getMessage());
|
||||
}
|
||||
yield new Amp\Delayed(500);
|
||||
}
|
||||
|
||||
});
|
Loading…
Reference in New Issue
Block a user