summaryrefslogtreecommitdiff
path: root/taskflow/patterns/ordered_flow.py
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2013-05-25 15:30:15 -0600
committerJoshua Harlow <harlowja@yahoo-inc.com>2013-05-25 15:30:15 -0600
commitde1af74125d8b264679b6736f10eb168217786f0 (patch)
tree08447087a560819c52876e9e1fffb6ba3de2692a /taskflow/patterns/ordered_flow.py
parent96125ed405702809cc9a5032fd84c8b914bc1ab6 (diff)
downloadtaskflow-de1af74125d8b264679b6736f10eb168217786f0.tar.gz
Add comment to why we accumulate before notifying task listeners.
Diffstat (limited to 'taskflow/patterns/ordered_flow.py')
-rw-r--r--taskflow/patterns/ordered_flow.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/taskflow/patterns/ordered_flow.py b/taskflow/patterns/ordered_flow.py
index 9b4bc08..5d20ec8 100644
--- a/taskflow/patterns/ordered_flow.py
+++ b/taskflow/patterns/ordered_flow.py
@@ -147,6 +147,10 @@ class Flow(object):
# if rollback occurs that the task gets exactly the
# result it returned and not a modified one.
self.results.append((task, result))
+ # Add the task result to the accumulator before
+ # notifying others that the task has finished to
+ # avoid the case where a listener might throw an
+ # exception.
self._accumulator.add(RollbackTask(context, task,
copy.deepcopy(result)))
self._on_task_finish(context, task, result)