Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add a heartbeat method to the py.Stream class (more below) #137

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

Merged
merged 1 commit into from
Nov 19, 2014

Conversation

theengineear
Copy link
Contributor

There are a number of ways to implement this, but this is the most
similar to how the rest of the library works. The best approach would
be to return messages from the server along with messages generated
in the library to give the user as much information as possible.

There are a number of ways to implement this, but this is the most
similar to how the rest of the library works. The best approach would
be to return messages from the server along with messages generated
in the library to give the user as much information as possible.
@theengineear
Copy link
Contributor Author

@bpostlethwaite , @chriddyp

I'm going to refactor this a bit now to try and grab the messages returned from the server.

@chriddyp
Copy link
Member

chriddyp commented Nov 8, 2014

Just curious from an infrastructure point of view - does holding a connection open take less resources than creating a new connection every few minutes? It seems like we're probably going to be limited by # of connections opened (a hard coded parameter) before we're limited by the cpu or memory usage required to open a connection.

I only bring this up because I'm not sure whether we want to encourage heartbeat'ing or not. If every streamer keeps their connection open for eternity, even though they're only send one point every 10 minutes, then it seems like we'll run out of connections.

@chriddyp
Copy link
Member

chriddyp commented Nov 8, 2014

In any case, this notebook will probably be helpful to you: http://nbviewer.ipython.org/github/chriddyp/chunked_requests/blob/master/stream.plot.ly.ipynb

@bpostlethwaite
Copy link
Member

Its better to keep one open (if needed), and I am just following stream conventions of twitter. As The user will have to write it explicitly in their scripts I don't think we will get many. Also, the point is moot really, we have a few connections open at any one time currently, but I built the infrastructure to scale to hundreds of thousands of connections quite easily.

@theengineear
Copy link
Contributor Author

@chriddyp , @bpostlethwaite , was this resolved? is this alright to merge in?

@chriddyp
Copy link
Member

+1

Sent from my iPhone

On Nov 18, 2014, at 6:25 PM, Andrew [email protected] wrote:

@chriddyp , @bpostlethwaite , was this resolved? is this alright to merge in?


Reply to this email directly or view it on GitHub.

@theengineear
Copy link
Contributor Author

thx!

theengineear added a commit that referenced this pull request Nov 19, 2014
Add a heartbeat method to the py.Stream class (more below)
@theengineear theengineear merged commit cad4279 into master Nov 19, 2014
@theengineear theengineear deleted the streaming-heartbeat branch November 19, 2014 01:10
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