From 4c68da0d3b8a90dd31c315c8061950143bb62c56 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 3 Oct 2013 17:05:40 -0400 Subject: [PATCH] Change to eventlet.wsgi instead of patched flup scgi --- confluent/console.py | 2 ++ confluent/httpapi.py | 11 +++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/confluent/console.py b/confluent/console.py index 97bfdb27..e87b282a 100644 --- a/confluent/console.py +++ b/confluent/console.py @@ -137,6 +137,8 @@ class ConsoleSession(object): self.reaper.cancel() currtime = util.monotonic_time() deadline = currtime + 45 + if self.databuffer is None: + return "" while len(self.databuffer) == 0 and currtime < deadline: timeo = deadline - currtime self.conshdl._console.wait_for_data(timeout=timeo) diff --git a/confluent/httpapi.py b/confluent/httpapi.py index 7d88b125..e1a2fd91 100644 --- a/confluent/httpapi.py +++ b/confluent/httpapi.py @@ -12,7 +12,8 @@ import json import os import string import urlparse -scgi = eventlet.import_patched('flup.server.scgi') +import eventlet.wsgi +#scgi = eventlet.import_patched('flup.server.scgi') consolesessions = {} @@ -152,7 +153,13 @@ def serve(): # either making apache deal with it # or just supporting nginx or lighthttpd # for now, http port access - scgi.WSGIServer(resourcehandler, bindAddress=("localhost",4004)).run() + #scgi.WSGIServer(resourcehandler, bindAddress=("localhost",4004)).run() + #based on a bakeoff perf wise, eventlet http support proxied actually did + #edge out patched flup. unpatched flup was about the same as eventlet http + #but deps are simpler without flup + #also, the potential for direct http can be handy + #todo remains unix domain socket for even http + eventlet.wsgi.server(eventlet.listen(("",4005)),resourcehandler) class HttpApi(object):