-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Revamp streaming #253
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
Revamp streaming #253
Conversation
@chriddyp thoughts on this? I've been playing around with coroutines in some of my hacking-time recently and thought I'd see if I could make our streaming use 'em! This streaming setup allows users to write to a queue regardless of connection state. You simply use the Additionally, it handles heart-beats on it's own instead of allowing our servers to shoot back a 408 code. |
We get a fair amount of feedback emails related to streaming, so I thought it might be worth looking into for our 1.7 release. |
woahh! here's a test server and file that I made from chunked requests: https://github.com/chriddyp/chunked_requests/tree/master/test, https://github.com/chriddyp/chunked_requests/blob/master/circle.yml |
super(ClosedConnection, self).__init__(self.message) | ||
|
||
|
||
class TooManyConnectFailures(PlotlyConnectionError): |
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.
nice
i probably won't have time for a while to do a deeper dive review of this, looks cool though! careful around the socket error numbers, that functionality in chunked_requests took me a while to figure out and get right with all the exception cases on both windows and mac. hopefully that test server with circle will be able to grab most of these. |
ah, nice test server! yeah, i saw a lot of commenting around those socket error numbers and figured that some serious time was poured into that :) i'll definitely take a closer peek before trying to get this merged in. |
Man, bummed this didn't get in, o well. Maybe i'll have time to revisit down the road. |
Todo:
This borrows from chunked requests, but moves the functionality so we don't need that extra submodule. It also attempts to clean up some of the code and make the reconnecting functionality more flexible.
The
asyncio
module comes standard in 3.4 and can be back ported to 3.3.trollius
is a stand-in forasyncio
that can be back ported into 2.7.Though there's still a fair amount of low-level interaction, this attempts to make the interface a bit higher-level.