Skip to content

Question: What async operations are allowed in a durable function? #1758

Answered by cgillum
dxynnez asked this question in Q&A
Discussion options

You must be logged in to vote

@dxynnez in the code you shared, it doesn't look like you're actually starting any async operations. You're just wrapping normal Durable operations in an async method, which is perfectly fine. Really, the thing that we need to protect against is introducing new threads into the orchestration's execution. The Durable Task Framework must control the single thread of execution in order to ensure determinism. APIs like Task.Delay and HttpClient.SendAsync typically have callbacks execute on worker pool threads, which is what causes problems. That's not happening in your case.

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by cgillum
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1713 on April 01, 2021 17:03.