result = func(*args, **kwds)
isError = False
except Exception, e:
- _moduleLogger.exception("Error, passing it back to the main thread")
+ _moduleLogger.error("Error, passing it back to the main thread")
result = e
isError = True
self.__workQueue.task_done()
_moduleLogger.debug("Shutting down worker thread")
-class AsyncLinearExecution(object):
-
- def __init__(self, pool, func):
- self._pool = pool
- self._func = func
- self._run = None
-
- def start(self, *args, **kwds):
- assert self._run is None
- self._run = self._func(*args, **kwds)
- trampoline, args, kwds = self._run.send(None) # priming the function
- self._pool.add_task(
- trampoline,
- args,
- kwds,
- self.on_success,
- self.on_error,
- )
-
- @misc.log_exception(_moduleLogger)
- def on_success(self, result):
- #_moduleLogger.debug("Processing success for: %r", self._func)
- try:
- trampoline, args, kwds = self._run.send(result)
- except StopIteration, e:
- pass
- else:
- self._pool.add_task(
- trampoline,
- args,
- kwds,
- self.on_success,
- self.on_error,
- )
-
- @misc.log_exception(_moduleLogger)
- def on_error(self, error):
- #_moduleLogger.debug("Processing error for: %r", self._func)
- try:
- trampoline, args, kwds = self._run.throw(error)
- except StopIteration, e:
- pass
- else:
- self._pool.add_task(
- trampoline,
- args,
- kwds,
- self.on_success,
- self.on_error,
- )
-
-
class AutoSignal(object):
def __init__(self, toplevel):