Merge "Relabel internal engine 'event' -> 'outcome'"
This commit is contained in:
@@ -196,8 +196,8 @@ class MachineBuilder(object):
|
||||
fut = memory.done.pop()
|
||||
atom = fut.atom
|
||||
try:
|
||||
event, result = fut.result()
|
||||
retain = do_complete(atom, event, result)
|
||||
outcome, result = fut.result()
|
||||
retain = do_complete(atom, outcome, result)
|
||||
if isinstance(result, failure.Failure):
|
||||
if retain:
|
||||
memory.failures.append(result)
|
||||
@@ -211,10 +211,10 @@ class MachineBuilder(object):
|
||||
intention = self._storage.get_atom_intention(
|
||||
atom.name)
|
||||
LOG.debug("Discarding failure '%s' (in"
|
||||
" response to event '%s') under"
|
||||
" response to outcome '%s') under"
|
||||
" completion units request during"
|
||||
" completion of atom '%s' (intention"
|
||||
" is to %s)", result, event,
|
||||
" is to %s)", result, outcome,
|
||||
atom, intention)
|
||||
except Exception:
|
||||
memory.failures.append(failure.Failure())
|
||||
|
||||
@@ -113,16 +113,16 @@ class Completer(object):
|
||||
self._retry_action = runtime.retry_action
|
||||
self._undefined_resolver = RevertAll(self._runtime)
|
||||
|
||||
def _complete_task(self, task, event, result):
|
||||
def _complete_task(self, task, outcome, result):
|
||||
"""Completes the given task, processes task failure."""
|
||||
if event == ex.EXECUTED:
|
||||
if outcome == ex.EXECUTED:
|
||||
self._task_action.complete_execution(task, result)
|
||||
else:
|
||||
self._task_action.complete_reversion(task, result)
|
||||
|
||||
def _complete_retry(self, retry, event, result):
|
||||
def _complete_retry(self, retry, outcome, result):
|
||||
"""Completes the given retry, processes retry failure."""
|
||||
if event == ex.EXECUTED:
|
||||
if outcome == ex.EXECUTED:
|
||||
self._retry_action.complete_execution(retry, result)
|
||||
else:
|
||||
self._retry_action.complete_reversion(retry, result)
|
||||
@@ -149,18 +149,18 @@ class Completer(object):
|
||||
unfinished_atoms.add(atom)
|
||||
return unfinished_atoms
|
||||
|
||||
def complete(self, node, event, result):
|
||||
def complete(self, node, outcome, result):
|
||||
"""Performs post-execution completion of a node.
|
||||
|
||||
Returns whether the result should be saved into an accumulator of
|
||||
failures or whether this should not be done.
|
||||
"""
|
||||
if isinstance(node, task_atom.BaseTask):
|
||||
self._complete_task(node, event, result)
|
||||
self._complete_task(node, outcome, result)
|
||||
else:
|
||||
self._complete_retry(node, event, result)
|
||||
self._complete_retry(node, outcome, result)
|
||||
if isinstance(result, failure.Failure):
|
||||
if event == ex.EXECUTED:
|
||||
if outcome == ex.EXECUTED:
|
||||
self._process_atom_failure(node, result)
|
||||
else:
|
||||
# Reverting failed, always retain the failure...
|
||||
|
||||
@@ -35,7 +35,7 @@ from taskflow.types import failure
|
||||
from taskflow.types import notifier
|
||||
from taskflow.utils import threading_utils
|
||||
|
||||
# Execution and reversion events.
|
||||
# Execution and reversion outcomes.
|
||||
EXECUTED = 'executed'
|
||||
REVERTED = 'reverted'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user