Repository navigation
Fix SDK bugs found by the live docs snippet tests #242
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -406,7 +406,25 @@ def unsubscribe_all(self) -> None: | |
| return self._subscription_registry.unsubscribe_all() | ||
|
|
||
| def reconnect(self) -> None: | ||
| return self._subscription_registry.reconnect() | ||
| """Restart the subscribe loop for the current subscriptions. | ||
|
|
||
| The event engine subscription manager (asyncio default) handles reconnection | ||
| itself, so there this call does nothing. | ||
| """ | ||
| self._validate_subscribe_manager_enabled() | ||
| return self._subscription_manager.reconnect() | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will work only for |
||
|
|
||
| def disconnect(self) -> None: | ||
| """Stop the subscribe loop and heartbeat timer without removing the subscriptions. | ||
|
|
||
| Raises: | ||
| PubNubException: If the subscription manager in use does not support disconnect. | ||
| """ | ||
| self._validate_subscribe_manager_enabled() | ||
| if not hasattr(self._subscription_manager, 'disconnect'): | ||
| raise PubNubException( | ||
| errormsg="disconnect() is not supported by %s" % type(self._subscription_manager).__name__) | ||
| return self._subscription_manager.disconnect() | ||
|
Comment on lines
+424
to
+427
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Situation similar to the |
||
|
|
||
| def heartbeat(self) -> Heartbeat: | ||
| """Send a heartbeat signal to the PubNub network. | ||
|
|
||
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.
Isn't our current contract according to the docs is
str?