我有一个具有两个Python函数的体系结构:ListCreator()和Activity()。 ListCreator()函数由HTTP触发器触发,并生成字符串列表。我想将此字符串列表传递给编排函数,并多次调用Activity()函数。
我该如何将其传递给编排者?我还需要在Microsoft文档中使用的启动功能吗?
我的代码的过度简化版本看起来像这样:
listCreator():
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse
mylist=['helo','world']
I have an architecture with two python functions: listcreator() and activity(). The listcreator() function is triggered by an http trigger and generates a list of strings. I want to pass this list of strings to an orchestrator function and call the activity() function multiple times.
How do I pass this to the orchestrator? Do I also need a starter function as desribed in the microsoft documents? https://learn.microsoft.com/nl-nl/azure/azure-functions/durable/quickstart-python-vscode
An oversimplified version of my code looks like this:
listcreator():
import azure.functions as func
def main(req: func.HttpRequest) -> func.HttpResponse
mylist=['helo','world']
发布评论
评论(1)
最好的解决方案可能是将您的
listCreator()
函数用作client> client function
(您称为启动器函数
)。从listCreator()
中,您可以生成列表并将其传递到andestrator
。最后,从编排器中,将列表传递到活动
函数并运行它。代码草图:
probably the best solution is to use your
listcreator()
function asClient function
(the function you called asstarter function
). From thelistcreator()
, you can generate the list and pass it to theorchestrator
. Finally from the orchestrator, pass the list to theactivity
function and run it.A sketch of code: