【问题标题】:Synchronous + Asynchronous steps in step function步进函数中的同步 + 异步步进
【发布时间】:2021-03-22 02:13:23
【问题描述】:

我对阶跃函数非常陌生,并且仍在探索相同的功能。 我有类似这样的工作流程

--Steps A to C are synchronous.
Step A
 if(respose is X)
   Step B
 else
   Step C
--Need to return response to user here and need to follow two below steps asynchronously to unblock the caller of step function.
Step D
Step E

有可能达到同样的效果吗?我相信,我会为步骤 A、B 和 C 附加 .sync。不会在 D 和 E 上附加任何内容,它应该可以工作。我在这里有什么遗漏吗?

请注意,所有步骤将仅由活动工作者执行。

【问题讨论】:

    标签: amazon-web-services asynchronous synchronous aws-step-functions


    【解决方案1】:

    我们可以采取两种方法。

    • 将步进函数分成两部分。前三个步骤将是一个快速步进函数,后两个步骤将是一个常规步进函数。 或
    • 我们可以只有一个 step 函数,无论何时调用这个 step 函数,我们都需要等待前三个步骤完成才能继续前进。这可以通过在循环中调用 get-execution-history 来获取中间步骤的输出来完成。 Here 是这种方法的答案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-03-12
      • 1970-01-01
      • 2012-07-25
      • 2021-09-23
      • 2013-12-25
      相关资源
      最近更新 更多