fixed some major reconnection errors

This commit is contained in:
Thom Nichols
2010-06-01 22:51:49 -04:00
parent 1780ca900a
commit 4eb210bff5
5 changed files with 138 additions and 124 deletions

View File

@@ -18,7 +18,7 @@ class BaseHandler(object):
def match(self, xml):
return self._matcher.match(xml)
def prerun(self, payload):
def prerun(self, payload): # what's the point of this if the payload is called again in run??
self._payload = payload
def run(self, payload):

View File

@@ -17,13 +17,15 @@ class Callback(base.BaseHandler):
self._once = once
self._instream = instream
def prerun(self, payload):
def prerun(self, payload): # prerun actually calls run?!? WTF! Then it gets run AGAIN!
base.BaseHandler.prerun(self, payload)
if self._instream:
logging.debug('callback "%s" prerun', self.name)
self.run(payload, True)
def run(self, payload, instream=False):
if not self._instream or instream:
logging.debug('callback "%s" run', self.name)
base.BaseHandler.run(self, payload)
#if self._thread:
# x = threading.Thread(name="Callback_%s" % self.name, target=self._pointer, args=(payload,))