Durable Functions - Awaitable Tasks inside Activity Function

0 favourites
  • 1 posts
From the Asset Store
94 Inside buildings views - Isometric view - PNG transparent - 2048x2048
  • I have a durable function that has inputs determined by a previous activity function For each activity function I have multiple awaitable tasks where each task is dependent on the previous task's output.

    This is my structure as follows:

    Orchestrator

    [FunctionName("MessageController")]

    public static async void Run(

    [OrchestrationTrigger] DurableOrchestrationContext context,

    TraceWriter log)

    {

    if (!context.IsReplaying) log.Warning("MessageController started");

    var Input1= context.CallActivityAsync<ResultMessage>("Function_1", new InputMessage());

    var Input2= context.CallActivityAsync<ResultMessage>("Function_2", Input1);

    var Input3= context.CallActivityAsync<ResultMessage>("Function_2", Input2);

    }

    Activity Function

    [FunctionName("Function_1")]

    public static ResultMessage Run(

    [ActivityTrigger] DurableActivityContext activityContext,

    TraceWriter log)

    {

    //Awaitable task

    var taskOutput= await DoSomething();

    //Awaitable task

    var token = await DoAnotherThing(taskOutput);

    }

    I have tested MindMajix Microsoft Azure this and all works fine. But i ma wondering if this is good practice? Is it normal to have awaitable tasks within an activity function for a durable function?

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)