[英]Does Durable Azure Function Orchestrator release lock on timer?
I have this code in my Azure Function:我的 Azure Function 中有此代码:
using var entityLock = await orchestrationContext.LockAsync(entityId);
for (int i = 0; i < 3; i++)
{
// call an entity function, if it does not succeed : wait with a timer like this and then try again
await orchestrationContext.CreateTimer(oneHourInTheFuture, CancellationToken.None);
}
I would like to understand if the lock will be held for the whole duration of the orchestration including the timer or the lock will be released when the orchestration is waiting.我想了解是否会在包括计时器在内的整个编排期间保持锁定,或者在编排等待时释放锁定。
Since the CreateTimer
is still in the using
statement, the lock will not be released.由于
CreateTimer
仍在using
语句中,因此不会释放锁。 The lock will be held for the whole duration of the orchestration including the timer in your case.锁定将在整个编排期间保持,包括您的情况下的计时器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.