I don't know that this does. Seriously, this returns a mapping of thread ids to tasks in that thread. It can be used to identify tasks by branch and use this information for decision making (despite the flawed implementation mechanism; IMO, this should be maintained by the
(self)
| 299 | return self.locks[name] |
| 300 | |
| 301 | def get_task_mapping(self): |
| 302 | """I don't know that this does. |
| 303 | |
| 304 | Seriously, this returns a mapping of thread ids to tasks in that thread. It can be used to identify |
| 305 | tasks by branch and use this information for decision making (despite the flawed implementation |
| 306 | mechanism; IMO, this should be maintained by the workflow rather than a class attribute). |
| 307 | """ |
| 308 | task_mapping = {} |
| 309 | for task in self.task_tree: |
| 310 | thread_task_mapping = task_mapping.get(task.thread_id, {}) |
| 311 | tasks = thread_task_mapping.get(task.task_spec, set()) |
| 312 | tasks.add(task) |
| 313 | thread_task_mapping[task.task_spec] = tasks |
| 314 | task_mapping[task.thread_id] = thread_task_mapping |
| 315 | return task_mapping |
| 316 | |
| 317 | def get_dump(self): |
| 318 | """Returns a string representation of the task tree. |