Hi @Satyam Chauhan , there are couple of different issues you are pointing here
- Make an asynchronous call to IoT Edge Hub trigger module -- We have already achieved this by removing the await key word before making the call to the "SendEventAsync". We
noticed this evidently when we add a delay in the function, the Edge Hub trigger function gets invoked without waiting for the entire list to iterate. Please note that the C# module function
does not wait any longer for the Edge Hub trigger function to return the Task and proceeds with iterating the list which indicates that the call is made asynchronously. - Can the order of execution be changed on IoT Edge Hub trigger-- Please note that when we send out an event through SendEventAsyc method, the messages will be queued and
passed along to the receiving end point. Please refer the below image that points to how SendEventAsyc function behaves.
Here is the Code Sample where you can find the above explanation of how the code behaves. Since the events are queued from the C# code module, the processing on the Edge Hub
trigger will always be sequential.
Hope this clarifies your question. Please let me know if you still have any doubts with regards to this issue.
----------
Kindly accept answer or upvote if the response is helpful so that it would benefit other community members facing the same issue. I highly appreciate your contribution to the community.