-
Notifications
You must be signed in to change notification settings - Fork 46
Add twisted support #18 #19
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
Conversation
The test failures seem to be because twisted dropped 2.6 support... Wouldn't suppose you could too? |
I think we could-- none of our Python customers are on 2.6. |
@@ -161,6 +161,7 @@ def _send(self, event): | |||
if self._queue.full(): | |||
log.warning("Event queue is full-- dropped an event") | |||
else: | |||
print("putting in {}".format(event)) |
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.
Scrap the debug code?
Conflicts: .gitignore
* add stop for stream producers * add ability to override stream producers and feature store classes * add no-cache header for stream requests * barely tested sse implementation for twisted
def is_alive(self): | ||
return self._looping_call is not None and self._looping_call.running | ||
|
||
def flush(self): |
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.
If flush is called on an empty queue, it will block until the next time _consume
has actual work to do. This could be longer than 5 seconds if the queue is empty.
I also think flush
should force an immediate request with the current queue contents, rather than merely acting as a synchronization point indicating that the next _consume
cycle has completed.
This is important for our integration tests-- our test harness connects to the same Pubnub channel as the dev console and checks for the presence of events to verify that the client is sending them properly. For the SDKs that implement flush as I've described it, the harness runs in about 5 minutes. Without flush, the twisted tests have been running for 30 minutes so far since we're waiting up to 5 seconds for each event to appear.
On the plus side the integration tests are passing 👍
* Change to stream_uri/features rather than postfixed event names * Fix flushing to force a real flush immediately * Change user agent for twisted SSE consumer
Passes all integration tests with flying colors. |
… parameter (#19) * increase minimum poll interval to 30s * add warning against disabling streaming * add docs for most of the config options
No description provided.