Skip to content
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

Expoential as a default reconnection policy #196

Merged
merged 8 commits into from
Oct 1, 2024

Conversation

seba-aln
Copy link
Contributor

No description provided.

@seba-aln seba-aln force-pushed the feat/exponential-reconnect-by-default branch from 42b26a3 to b9db664 Compare September 26, 2024 20:40
@seba-aln seba-aln marked this pull request as ready for review September 26, 2024 21:56
@@ -89,6 +93,26 @@ def _stop_heartbeat_timer(self):
self._timer = None


class LinearDelay:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to provide custom delay other than 2?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not really. Should we add this option?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added in latest commit. thanks for pointing that out ;)

@@ -101,6 +101,13 @@ def __init__(self, pubnub):
def _register_heartbeat_timer(self):
self.stop_heartbeat_timer()

if self._retry_limit_reached():

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know how it works in Python, but should announcing disconnected status being part of EE?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No. This one is for non-event engine subscribe (yeah, python has more than one subscribe)

context.pubnub.subscribe().channels('foo').execute()


@when('I subscribe with timetoken {timetoken}')
def step_impl(context: PNContext, timetoken: str): # noqa F811
@async_run_until_complete
async def step_impl(context: PNContext, timetoken: str): # noqa F811

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious, what it means? # noqa F811

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it disables validation errors upon redeclaration of method. in this file there are more methods called step_impl, but they are the content of a @when decorator. so TL:DR - 'tis just for linter

@seba-aln seba-aln force-pushed the feat/exponential-reconnect-by-default branch 2 times, most recently from bcc837f to b6746db Compare October 1, 2024 11:11
@jguz-pubnub jguz-pubnub self-requested a review October 1, 2024 13:03
@seba-aln seba-aln merged commit 0d47e58 into master Oct 1, 2024
9 checks passed
@seba-aln seba-aln deleted the feat/exponential-reconnect-by-default branch October 1, 2024 13:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants