1- const df = require ( " durable-functions" ) ;
1+ const df = require ( ' durable-functions' )
22
3- module . exports = df ( function * ( context ) {
4- // retrieves the organization name from the Orchestrator_HttpStart function
5- var organizationName = context . df . getInput ( ) ;
6- // retrieves the list of repositories for an organization by invoking a separate Activity Function.
7- var repositories = yield context . df . callActivityAsync ( "GetAllRepositoriesForOrganization" , organizationName ) ;
3+ module . exports = df ( function * ( context ) {
4+ // retrieves the organization name from the Orchestrator_HttpStart function
5+ var organizationName = context . df . getInput ( )
6+ // retrieves the list of repositories for an organization by invoking a separate Activity Function.
7+ var repositories = yield context . df . callActivityAsync (
8+ 'GetAllRepositoriesForOrganization' ,
9+ organizationName
10+ )
811
9- // Creates an array of task to store the result of each functions
10- var output = [ ] ;
11- for ( var i = 0 ; i < repositories . length ; i ++ ) {
12- // Starting a `GetOpenedIssues` activity WITHOUT `yield`
13- // This will starts Activity Functions in parallel instead of sequentially.
14- output . push ( context . df . callActivityAsync ( "GetOpenedIssues" , repositories [ i ] ) ) ;
15- }
12+ // Creates an array of task to store the result of each functions
13+ var output = [ ]
14+ for ( var i = 0 ; i < repositories . length ; i ++ ) {
15+ // Starting a `GetOpenedIssues` activity WITHOUT `yield`
16+ // This will starts Activity Functions in parallel instead of sequentially.
17+ output . push (
18+ context . df . callActivityAsync ( 'GetOpenedIssues' , repositories [ i ] )
19+ )
20+ }
1621
17- // Wait for all Activity Functions to complete execution
18- const results = yield context . df . Task . all ( output ) ;
22+ // Wait for all Activity Functions to complete execution
23+ const results = yield context . df . Task . all ( output )
1924
20- // Send the list to an Activity Function to save them to Blob Storage.
21- yield context . df . callActivityAsync ( " SaveRepositories" , results ) ;
25+ // Send the list to an Activity Function to save them to Blob Storage.
26+ yield context . df . callActivityAsync ( ' SaveRepositories' , results )
2227
23- return context . instanceId ;
24- } ) ;
28+ return context . instanceId
29+ } )
0 commit comments