Repository navigation
Standardize README and refresh DEVELOPER guide - #238
Conversation
Rewrite README.md to the standard PubNub SDK template and update DEVELOPER.md with current Python versions, test, lint and call-style guidance.
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
parfeon
left a comment
There was a problem hiding this comment.
It looks good but I think demo can be improved to use new subscription approach through subscription and subscription set. Can you please verify example and use if it fits?
| try: | ||
| pubnub.subscribe().channels("hello_world").execute() | ||
|
|
||
| if not listener.connected.wait(timeout=10): | ||
| raise TimeoutError("Timed out waiting for the subscription to connect") | ||
|
|
||
| pubnub.publish().channel("hello_world").message("Hello world").sync() | ||
|
|
||
| if not listener.received.wait(timeout=10): | ||
| raise TimeoutError("Timed out waiting for the message") | ||
| finally: | ||
| pubnub.unsubscribe().channels("hello_world").execute() | ||
| pubnub.remove_listener(listener) | ||
| pubnub.stop() |
There was a problem hiding this comment.
What it we would use newer approach for demo which utilize Subscription / SubscriptionSet?
| try: | |
| pubnub.subscribe().channels("hello_world").execute() | |
| if not listener.connected.wait(timeout=10): | |
| raise TimeoutError("Timed out waiting for the subscription to connect") | |
| pubnub.publish().channel("hello_world").message("Hello world").sync() | |
| if not listener.received.wait(timeout=10): | |
| raise TimeoutError("Timed out waiting for the message") | |
| finally: | |
| pubnub.unsubscribe().channels("hello_world").execute() | |
| pubnub.remove_listener(listener) | |
| pubnub.stop() | |
| subscription = pubnub.channels("hello_world").subscription() | |
| try: | |
| subscription.subscribe() | |
| if not listener.connected.wait(timeout=10): | |
| raise TimeoutError("Timed out waiting for the subscription to connect") | |
| pubnub.publish().channel("hello_world").message("Hello world").sync() | |
| if not listener.received.wait(timeout=10): | |
| raise TimeoutError("Timed out waiting for the message") | |
| finally: | |
| subscription.unsubscribe() | |
| pubnub.remove_listener(listener) | |
| pubnub.stop() |
Will this work for us?
There was a problem hiding this comment.
Yes, I will use an example with Subscription
parfeon
left a comment
There was a problem hiding this comment.
It looks good but I think demo can be improved to use new subscription approach through subscription and subscription set. Can you please verify example and use if it fits?
No description provided.