@@ -406,7 +406,7 @@ def _get_future_from_lambda_function_event(self, event):
406406 elif state == 'started' :
407407 future .set_running ()
408408 elif state == 'completed' :
409- future .set_finished (json_loads_or_raw (event ['result' ]))
409+ future .set_finished (format . decode (event ['result' ]))
410410 elif state == 'failed' :
411411 future .set_exception (exceptions .TaskFailed (
412412 name = event ['id' ],
@@ -872,30 +872,12 @@ def resume_lambda_function(self, a_task, event):
872872
873873 return future
874874
875- def resume_lambda_function (self , a_task , event ):
876- """
877- Resume a child workflow.
878-
879- :param a_task:
880- :type a_task: LambdaTask
881- :param event:
882- :type event: dict
883- :return:
884- :rtype: simpleflow.futures.Future
885- """
886- future = self ._get_future_from_lambda_function_event (event )
887-
888- if future .finished and future .exception :
889- raise future .exception
890-
891- return future
892-
893875 def schedule_task (self , a_task , task_list = None ):
894876 """
895877 Let a task schedule itself.
896878 If too many decisions are in flight, add a timer decision and raise ExecutionBlocked.
897879 :param a_task:
898- :type a_task: SwfTask
880+ :type a_task: ActivityTask | WorkflowTask | SignalTask [ MarkerTask [ TimerTask | CancelTimerTask | LambdaFunctionTask # noqa
899881 :param task_list:
900882 :type task_list: Optional[str]
901883 :raise: exceptions.ExecutionBlocked if too many decisions waiting
@@ -1488,8 +1470,9 @@ def get_event_details(self, event_type, event_name):
14881470
14891471 def handle_cancel_requested (self ):
14901472 decision = swf .models .decision .WorkflowExecutionDecision ()
1491- is_current_decision = self ._history .completed_decision_id < self ._history .cancel_requested_id
1492- should_cancel = self ._workflow .should_cancel (self ._history )
1473+ history = self ._history
1474+ is_current_decision = history .completed_decision_id < history .cancel_requested_id
1475+ should_cancel = self ._workflow .should_cancel (history )
14931476 if not should_cancel :
14941477 return None # ignore cancel
14951478 if is_current_decision :
0 commit comments