Пример #1
0
def execute_in_process(task_name, task_id, task_modules, *args, **kwargs):
    import_modules(task_modules)
    logger = logging.getLogger('task.request.execute_in_process')
    logger.debug('Preparing to execute %s of %s' % (task_name,task_id))
    try:
        task = registry[task_name]
    except registry.NotRegistered, e:
        logger.error("Registry tasks: %s not available" % task_name)
        raise e
Пример #2
0
 def __init__(self, pool = None, task_modules = None, beat = 5):
     self.pool         = pool
     self.task_modules = task_modules
     import_modules(task_modules)
     self._cache       = {}
     self._cachecode   = {}
     self.logger = logging.getLogger('unuk.task.Controller')
     schedule  = get_schedule()
     scheduler = self.PeriodicScheduler(entries = schedule,
                                        controller = self,
                                        beat = beat)
     self.scheduler  = scheduler
     self._scheduler = ThreadedClockService(scheduler)