Azure Durable Functions #4 – Orchestrator Constraints
There are some constraints when adding code in to the orchestrator code. It is because of the replay behavior in orchestrator.
When you adding code in to Orchestrator make sure you follow the following rules. (Not hard to follow :) )
1. Orchestrator should be deterministic
This means we should not add following type of code in to it.
- Getting current date time : This is because when it replays value will be changed
- Generating random numbers or Guids : This is because when it replays value will be changed
- Getting values from a DB : This is because when replayed values in the DB could be changed
- Pass it to orchestrator in the parameter when calling it
- Create a separate function activity to get the value and call it in the orchestrator
2. Orchestrator should be non blocking
No I/O calls or Thread.sleep should be used
3. Orchestrator should never initiate any async operation
This is because orchestrator runs on a single thread, It cannot interact with any other thread. So you should avoid using
ask.Run
,Task.Delay
HttpClient.SendAsync
4. Orchestrator should avoid Infinite loops This is because orchestrator function stores history if infinite loop runs, function could run out of memory.Hope this helps.
Happy Coding !!!!
This comment has been removed by a blog administrator.
ReplyDeleteI feel extremely glad to have seen your site page and anticipate such a large number of additionally engaging occasions perusing here. Much obliged again for all the subtleties.
ReplyDeletehttps://360digitmg.com/course/artificial-intelligence-ai-and-deep-learning
I think I have never watched such online diaries ever that has absolute things with all nuances which I need. So thoughtfully update this ever for us.
ReplyDelete360DigiTMG big data course malaysia
The information you have posted is important. The objections you have insinuated was worthy. Thankful for sharing.
ReplyDeleteiot training in noida
Thankyou for this wondrous post, I am cheerful I watched this site on yahoo. 360digitmg
ReplyDeleteI think I have never watched such online diaries ever that has absolute things with all nuances which I need. So thoughtfully update this ever for us.
ReplyDelete360DigiTMG data analytics training
I think this is the minimum value to earn more than just commit
ReplyDeletehrdf training course
It was worthy experience to get some answers concerning hazardous complement. Valuable for everyone looking with respect to the issue.
ReplyDeletedata science course in noida
Special Forces Group 2 Mod Apk
ReplyDeleteI want to encourage yourself to continue your great posts, have a nice day!
Many many thanks for this awesome article. This post really helped me a lot. Waiting for your next article. Thanks a lot.
ReplyDelete