Permalink
Browse files

twisted moved from 10.1-11.1

  • Loading branch information...
1 parent 08aafdc commit 56f095dbcb6bc93e848c124c3099ca006f2f7f3a mike committed Jul 25, 2013
Showing with 7 additions and 8 deletions.
  1. +3 −4 codenode/backend/core.py
  2. +2 −3 codenode/backend/engine.py
  3. +2 −1 codenode/frontend/async/backend.py
View
@@ -86,7 +86,7 @@ def addProcess(self, name, proc_config):
p.name = name
proc_config.processProtocol = p
self.processes[name] = proc_config
- if self.active:
+ if self.running:
self.startProcess(name)
return p.deferred
@@ -102,7 +102,6 @@ def startProcess(self, name):
env = p_conf.env
path = p_conf.path
self.timeStarted[name] = time.time()
- p.deferred.setTimeout(self.START_TIMEOUT)
reactor.spawnProcess(p, bin, args=args, env=env, path=path)
def interruptProcess(self, name):
@@ -280,13 +279,13 @@ def handleRequest(self, access_id, msg):
log.msg('handling engine request for %s' % access_id)
try:
engine_client = yield self.backend.getEngine(access_id)
- log.msg('got engine Client %s' % str(engine_client))
+ log.msg('got engine Client %s of type %s' % (str(engine_client), type(engine_client)))
except InvalidAccessId:
err = {'status':'ERR', 'response':'InvalidAccessId'}
log.err('InvalidAccessId %s' % access_id)
defer.returnValue(err)
- result = yield engine_client.send(msg)
+ result = yield engine_client.send(msg)
sucs = {'status':'OK', 'response':result}
defer.returnValue(sucs)
@@ -122,14 +122,13 @@ def send(self, msg):
except KeyError:
log.err("Engine client has no method '%s'!" % (engine_method,))
defer.returnValue({'result':'err'})
- result = yield meth(engine_arg, cellid)
+ result = yield defer.maybeDeferred(meth,engine_arg, cellid)
defer.returnValue(result)
- @defer.inlineCallbacks
def engine_start(self, args, arg):
"""dummy
"""
- defer.returnValue({'result':'started'})
+ return {'result':'started'}
@defer.inlineCallbacks
@@ -214,7 +214,8 @@ def render(self, request):
def _success(self, data, request, cellid):
"""
horrible. not always eval...
- """
+ """
+ print "\n\n\n",repr(data) , "\n\n\n\n"
log.msg('handling data: %s' % str(data))
data['cellid'] = cellid
jsobj = json.dumps(data)

0 comments on commit 56f095d

Please sign in to comment.