Skip to content

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

Merged
merged 16 commits into from
Sep 14, 2015
Merged

Add twisted support #18 #19

merged 16 commits into from
Sep 14, 2015

Conversation

mrdon
Copy link
Contributor

@mrdon mrdon commented Sep 8, 2015

No description provided.

@mrdon
Copy link
Contributor Author

mrdon commented Sep 8, 2015

The test failures seem to be because twisted dropped 2.6 support... Wouldn't suppose you could too?

@jkodumal
Copy link
Contributor

jkodumal commented Sep 8, 2015

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))
Copy link
Contributor

Choose a reason for hiding this comment

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

Scrap the debug code?

* 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):
Copy link
Contributor

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
@jkodumal
Copy link
Contributor

Passes all integration tests with flying colors.

jkodumal added a commit that referenced this pull request Sep 14, 2015
@jkodumal jkodumal merged commit 628de9a into launchdarkly:master Sep 14, 2015
ashanbrown pushed a commit that referenced this pull request Dec 22, 2017
… parameter (#19)

* increase minimum poll interval to 30s
* add warning against disabling streaming
* add docs for most of the config options
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