Internal

  • The second call will generate a new task instance depends on (ch1, ch2, ch3) and return a new Channel.

task = Task()
output_ch = task(ch1, ch2, ch3)
  • For each task instance, will get a unique task_key equals to it’s working directory, since a task object can be used multiple times, so there may be multiple tasks share the same task_key.

task.task_key = classname-hash(task.run_job.__code__ + task.run.__annotation__ + other_info)
task.task_workdir = task.config_dict.task_workdir/task.task_key
  • For each input of task.run, the run will have a run_key equals to it’s working directory

run.task_workdir = run_key = task.task_workdir/hash(inputs, other_info)
  • All task objects with the same task_key will share the same lock pool and cache, different runs will be scheduled in parallel but runs with the same run_key will compete for a sharing run_key lock to avoid conflictions.

  • For task receives no input channels, the task’s will only be ran once

output_ch = task()