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
If you want to have such values in the orchestrator you could
  • 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 !!!!



Comments

  1. This comment has been removed by a blog administrator.

    ReplyDelete
  2. I 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.


    https://360digitmg.com/course/artificial-intelligence-ai-and-deep-learning

    ReplyDelete
  3. 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.
    360DigiTMG big data course malaysia

    ReplyDelete
  4. The information you have posted is important. The objections you have insinuated was worthy. Thankful for sharing.
    iot training in noida

    ReplyDelete
  5. Thankyou for this wondrous post, I am cheerful I watched this site on yahoo. 360digitmg

    ReplyDelete
  6. 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.
    360DigiTMG data analytics training

    ReplyDelete
  7. I think this is the minimum value to earn more than just commit
    hrdf training course

    ReplyDelete
  8. It was worthy experience to get some answers concerning hazardous complement. Valuable for everyone looking with respect to the issue.

    data science course in noida

    ReplyDelete
  9. Special Forces Group 2 Mod Apk
    I want to encourage yourself to continue your great posts, have a nice day!

    ReplyDelete
  10. Many many thanks for this awesome article. This post really helped me a lot. Waiting for your next article. Thanks a lot.

    ReplyDelete

Post a Comment

Popular posts from this blog

Responsive Web Design

Contract First Development in WCF 4.5

Affine Cipher in C#