-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improvement handle disconnects and reconnect when appropriate #3
Improvement handle disconnects and reconnect when appropriate #3
Conversation
…disconnects-and-reconnect-when-appropriate
src/AsyncClient.php
Outdated
$event = Event::createFromMessage($message); | ||
|
||
if ($event->getEvent() === 'pusher:error') { | ||
return Observable::fromPromise(reject(new PusherErrorException($event->getData()['message'], $event->getData()['code']))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line exceeds 120 characters; contains 142 characters
src/AsyncClient.php
Outdated
*/ | ||
private function handleLowLevelError(Throwable $throwable) | ||
{ | ||
if (!($throwable instanceof WebsocketErrorException) && !($throwable instanceof RuntimeException) && !($throwable instanceof PusherErrorException)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line exceeds 120 characters; contains 157 characters
tests/AsyncClientTest.php
Outdated
$observable = Observable::error($error, new ImmediateScheduler()); | ||
$client = new AsyncClient($observable); | ||
$client->channel('test')->subscribe( | ||
function () {}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing brace must be on a line by itself
tests/AsyncClientTest.php
Outdated
$resolver->resolve('ws.pusherapp.com')->shouldBeCalled()->willReturn(reject($error)); | ||
$client = AsyncClient::create($loop, 'abc', $resolver->reveal()); | ||
$client->channel('test')->subscribe(); | ||
$loop->addTimer(1, function () {}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Closing brace must be on a line by itself
src/AsyncClient.php
Outdated
*/ | ||
private function handleLowLevelError(Throwable $throwable) | ||
{ | ||
if ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected 0 spaces after opening bracket; newline found
Closes #2
Requires RxPHP/RxWebsocket#9 / RxPHP/RxWebsocket#10