Internal¶
The second call will generate a new task instance depends on
(ch1, ch2, ch3)and return a newChannel.
task = Task()
output_ch = task(ch1, ch2, ch3)
For each task instance, will get a unique
task_keyequals to it’s working directory, since a task object can be used multiple times, so there may be multiple tasks share the sametask_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 arun_keyequals to it’s working directory
run.task_workdir = run_key = task.task_workdir/hash(inputs, other_info)
All task objects with the same
task_keywill share the samelock poolandcache, different runs will be scheduled in parallel but runs with the samerun_keywill compete for a sharingrun_keylock to avoid conflictions.For task receives no input channels, the task’s will only be ran once
output_ch = task()