简体   繁体   English

定时器触发持久功能调度

[英]Timer triggered Durable function schedule

I am currently building an azure durable function for my organization.我目前正在为我的组织构建一个 azure 持久功能。 The requirement is to run this orchestration every weekday during midnight.要求是在每个工作日的午夜运行此编排。 With eternal functions we can only provide a delay.对于永恒的功能,我们只能提供延迟。 How can I achieve this goal through a cron expression as such?我怎样才能通过这样的 cron 表达式来实现这个目标?

Can I create a Timer triggered Durable function?我可以创建一个 Timer 触发的 Durable 函数吗? Is there any limitation?有什么限制吗? Or should I create a HTTP Triggered durable function in which the orchestrator waits for an external event;或者我应该创建一个 HTTP 触发的持久函数,其中编排器等待外部事件; and then have a normal timer trigger azure function raise that event according to the Cron expression?然后有一个正常的计时器触发天蓝色函数根据 Cron 表达式引发该事件?

You can define timer-triggered function with DurableOrchestrationClient input binding.您可以使用DurableOrchestrationClient输入绑定定义计时器触发函数。 Please see below sample declaration:请参阅下面的示例声明:

[FunctionName("TimerDurableFunctionStarter")]
public static async Task Run(
    [TimerTrigger("0 */1 * * * *")] TimerInfo info,
    [DurableClient] IDurableOrchestrationClient timerDurableOrchestratorStarter)
{
   string instanceId = await timerDurableOrchestratorStarter.StartNewAsync("<<OrchestratorFunctionName>>");
}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM