I have been doing some reading on Durable Functions using C# and long running tasks and am trying to think of a way they could work with a long running Graph API call (for example, against a Group's Users). I understand that paging would be returned from the Graph call (using the C# Graph SDK) and am trying to think of a way that an Orchestration could continue processing work from a NextPage request until there are no more pages.
A few ideas I had were:
-
Persist the nextToken from each Graph call in an external data source and when the Orchestration wakes up it would get this token and use it to call an activity function until the nextToken returns null. But I am concerned this goes against the non-deterministic principle of the Orchestration Function.
-
Use a Page Iterator https://docs.microsoft.com/en-us/graph/sdks/paging?tabs=csharp and call an activity function on each iteration to process each page result. (maybe using the fan out/fan in pattern to process, also keeping Graph Throttling in mind)
-
Get all the pages of Users first from an Activity Function and process them in a foreach loop - simple but I wonder about the in memory store as well as problems with a large result set.
I just thought I would ask and see to make sure I am thinking about this correctly. The last thing I am wondering is that this may not be possible or practical with this framework. Thank you.
https://stackoverflow.com/questions/65374085/durable-functions-with-graph-api-paging-call December 20, 2020 at 04:21AM
没有评论:
发表评论