def launch_task(self, task_id, executable, *args, **kwargs):
''' Handle the actual submission of the task to the executor layer
We should most likely add a callback at this point
Args:
task_id (uuid string) : A uuid string that uniquely identifies the task
executable (callable) : A callable object
args (list of positional args)
kwargs (list of keyword args)
Returns:
Future that tracks the execution of the submitted executable
'''
#logger.debug("Submitting to executor : %s", task_id)
exec_fu = self.executor.submit(executable, *args, **kwargs)
exec_fu.add_done_callback(partial(self.handle_update, task_id))
return exec_fu
评论列表
文章目录