{"id":18063234,"url":"https://github.com/scale-tone/repeating-map-reduce-sample","last_synced_at":"2025-09-07T01:04:51.820Z","repository":{"id":87790919,"uuid":"439090459","full_name":"scale-tone/repeating-map-reduce-sample","owner":"scale-tone","description":null,"archived":false,"fork":false,"pushed_at":"2024-08-25T16:53:18.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-05T13:26:50.281Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scale-tone.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-12-16T18:31:29.000Z","updated_at":"2024-08-25T16:53:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"24775ff3-6e31-43d4-a7c6-1b8e8a285372","html_url":"https://github.com/scale-tone/repeating-map-reduce-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/scale-tone/repeating-map-reduce-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2Frepeating-map-reduce-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2Frepeating-map-reduce-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2Frepeating-map-reduce-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2Frepeating-map-reduce-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scale-tone","download_url":"https://codeload.github.com/scale-tone/repeating-map-reduce-sample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scale-tone%2Frepeating-map-reduce-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273983110,"owners_count":25202095,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-06T02:00:13.247Z","response_time":2576,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-31T05:10:18.255Z","updated_at":"2025-09-07T01:04:51.796Z","avatar_url":"https://github.com/scale-tone.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"```mermaid\n\ngraph LR\nHttpStart{{\"#32;HttpStart\"}}:::function\nstyle HttpStart fill:#D9D9FF,stroke-width:2px\nHttpStart.httpTrigger\u003e\"#127760; http:[get,post]\"]:::httpTrigger --\u003e HttpStart\nTestRestApiMethod{{\"#32;TestRestApiMethod\"}}:::function\nstyle TestRestApiMethod fill:#D9D9FF,stroke-width:2px\nTestRestApiMethod.httpTrigger\u003e\"#127760; http:[get]\"]:::httpTrigger --\u003e TestRestApiMethod\nMapReduceOrchestrator[[\"#32;MapReduceOrchestrator\"]]:::orchestrator\nstyle MapReduceOrchestrator fill:#D9D9FF,stroke-width:2px\nHttpStart ---\u003e MapReduceOrchestrator\nMapReduceOrchestrator -- \"[ContinueAsNew]\" --\u003e MapReduceOrchestrator\nProcessingActivity[/\"#32;ProcessingActivity\"/]:::activity\nstyle ProcessingActivity fill:#D9D9FF,stroke-width:2px\nMapReduceOrchestrator ---\u003e ProcessingActivity\n```\n\n# repeating-map-reduce-sample\n\nDemonstrates how to:\n1. Implement map/reduce scenarios with [Azure Durable Functions](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-overview?tabs=csharp).\n2. Run an [eternal orchestration](https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-eternal-orchestrations?tabs=csharp), that perpetually restarts itself, passing some data that resulted from previous execution as input.\n\n## How to run locally\n\n* Clone this repo.\n* In the project's folder create a `local.settings.json` file, which should look like this:\n\n```\n{\n  \"IsEncrypted\": false,\n  \"Values\": {\n    \"AzureWebJobsStorage\": \"your-azure-storage-connection-string\",\n    \"FUNCTIONS_WORKER_RUNTIME\": \"dotnet\"\n  }\n}\n```\n\n* Go to the project's folder with your command prompt and type the following:\n\n```\nfunc start\n```\n\n* Navigate to http://localhost:7071/api/HttpStart\n\nThis will start a singleton orchestration instance, which will proceed with executing some parallel activities, then sleep for a while and then restart itself. Invoking http://localhost:7071/api/HttpStart again will forcibly restart this orchestration (cancel all current execution history and start the process again).\n\nNote, that because this is a *singleton* orchestration, there is no need to implement any periodic storage cleanup.\n\nAlso note this setting in [host.json](https://github.com/scale-tone/repeating-map-reduce-sample/blob/main/host.json) file:\n```\n    \"extensions\": {\n        \"durableTask\": {\n            \"overridableExistingInstanceStates\": 0\n        }\n    }    \n```\n\nThis is essential for enabling the orchestration to be forcibly restarted (by default, `StartNewAsync()` method throws an exception if an instance with given id already exists).\n\nOnce up and running, you can monitor the orchestration's status with [Durable Functions Monitor](https://marketplace.visualstudio.com/items?itemName=DurableFunctionsMonitor.durablefunctionsmonitor):\n\n![image](https://user-images.githubusercontent.com/5447190/126574599-cab4bfa0-9fde-470c-9cc6-d072abbf2b5e.png)\n\n## How to deploy to Azure\n\n[![Deploy to Azure](https://aka.ms/deploytoazurebutton)](https://portal.azure.com/#create/Microsoft.Template/uri/https%3A%2F%2Fraw.githubusercontent.com%2Fscale-tone%2Frepeating-map-reduce-sample%2Fmain%2Farm-template.json)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscale-tone%2Frepeating-map-reduce-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscale-tone%2Frepeating-map-reduce-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscale-tone%2Frepeating-map-reduce-sample/lists"}