Skip to content

Commit 995e4b8

Browse files
committed
Add LambdaFunctionTask
Currently SWF only; needs to be moved upward. And with some rough edges... Signed-off-by: Yves Bastide <yves@botify.com>
1 parent a4c6164 commit 995e4b8

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

simpleflow/swf/executor.py

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ def _get_future_from_child_workflow_event(self, event):
342342
future.set_finished(format.decode(event['result']))
343343
elif state == 'failed':
344344
future.set_exception(exceptions.TaskFailed(
345-
name=event['id'],
345+
name=event['name'],
346346
reason=event['reason'],
347347
details=event.get('details'),
348348
))
@@ -721,6 +721,24 @@ def resume_lambda_function(self, a_task, event):
721721

722722
return future
723723

724+
def resume_lambda_function(self, a_task, event):
725+
"""
726+
Resume a child workflow.
727+
728+
:param a_task:
729+
:type a_task: LambdaTask
730+
:param event:
731+
:type event: dict
732+
:return:
733+
:rtype: simpleflow.futures.Future
734+
"""
735+
future = self._get_future_from_lambda_function_event(event)
736+
737+
if future.finished and future.exception:
738+
raise future.exception
739+
740+
return future
741+
724742
def schedule_task(self, a_task, task_list=None):
725743
"""
726744
Let a task schedule itself.

0 commit comments

Comments
 (0)