Skip to content

Conversation

drichelson
Copy link
Contributor

Reconnect when no data is received for 5 minutes.


name = m.groupdict()['name']
value = m.groupdict()['value']
if name == '':
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this wasn't actually working.

self.resp = requester.get(
self.url,
stream=True,
timeout=(self._connect_timeout, self._read_timeout),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Setting the read_timeout here means that the request will throw a timeout error if no data is received for 5 minutes.. thus implementing heartbeat detection.

store.delete(key, version)
else:
log.warning('Unhandled event in stream processor: ' + msg.event)
elif msg.event != 'comment':
Copy link
Contributor

Choose a reason for hiding this comment

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

change this back

and return a Event object.
"""
msg = cls()
if raw.startswith(':'):
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this-- not necessary.

@jkodumal
Copy link
Contributor

👍

@drichelson drichelson merged commit 6e51add into master Jan 10, 2017
@drichelson drichelson deleted the dr/heartbeats branch January 10, 2017 03:09
eli-darkly added a commit that referenced this pull request Aug 3, 2018
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.

3 participants