{"id":15421847,"url":"https://github.com/jviau/durabletask-hosting","last_synced_at":"2025-04-19T15:34:00.113Z","repository":{"id":40661179,"uuid":"255410067","full_name":"jviau/durabletask-hosting","owner":"jviau","description":"A Microsoft.Extensions.Hosting wrapper around the Microsoft.Azure.DurableTask framework.","archived":false,"fork":false,"pushed_at":"2025-03-10T17:07:45.000Z","size":699,"stargazers_count":30,"open_issues_count":7,"forks_count":8,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-13T13:03:50.974Z","etag":null,"topics":["azure","dependency-injection","durabletask","hosting","orchestrations"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jviau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2020-04-13T18:27:47.000Z","updated_at":"2025-04-02T15:24:09.000Z","dependencies_parsed_at":"2024-10-01T17:36:02.391Z","dependency_job_id":"31566431-463b-484a-8c84-5c259e6ab335","html_url":"https://github.com/jviau/durabletask-hosting","commit_stats":{"total_commits":123,"total_committers":3,"mean_commits":41.0,"dds":0.04065040650406504,"last_synced_commit":"479cd96016c56363575e18e7157f111839baa107"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviau%2Fdurabletask-hosting","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviau%2Fdurabletask-hosting/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviau%2Fdurabletask-hosting/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jviau%2Fdurabletask-hosting/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jviau","download_url":"https://codeload.github.com/jviau/durabletask-hosting/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249220841,"owners_count":21232421,"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","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":["azure","dependency-injection","durabletask","hosting","orchestrations"],"created_at":"2024-10-01T17:36:00.191Z","updated_at":"2025-04-16T08:33:01.016Z","avatar_url":"https://github.com/jviau.png","language":"C#","funding_links":[],"categories":["azure"],"sub_categories":[],"readme":"# DurableTask-Hosting\n\n[![Build](https://github.com/jviau/durabletask-hosting/workflows/.NET%20Core/badge.svg)](https://github.com/jviau/durabletask-hosting/actions?query=workflow%3A%22.NET+Core%22)\n\nHosting: \n[![Nuget Preview](https://img.shields.io/nuget/vpre/Vio.DurableTask.Hosting.svg)](https://www.nuget.org/packages/Vio.DurableTask.Hosting)\n\nDependency Injection: \n[![Nuget Preview](https://img.shields.io/nuget/vpre/Vio.DurableTask.DependencyInjection.svg)](https://www.nuget.org/packages/Vio.DurableTask.DependencyInjection)\n\nA [Microsoft.Extensions.Hosting](https://www.nuget.org/packages/Microsoft.Extensions.Hosting/) wrapper around the [azure/durabletask](https://github.com/azure/durabletask) framework.\n\n## Getting Started\n\nSee [Samples](./samples/DurableTask.Samples) for a quick start example.\n\n1. Add nuget package: `dotnet add package Vio.DurableTask.Hosting`\n2. Add to your host builder:\n\n``` CSharp\nawait Host.CreateDefaultBuilder()\n    .ConfigureServices(services =\u003e\n    {\n        // Can configure orchestrations, activities, and middleware in the service\n        // container with any scope desired.\n        services.AddSingleton\u003cMySingletonOrchestration\u003e();\n        services.AddScoped\u003cMyScopedMiddleware\u003e(); // must implement \"ITaskMiddleware\"\n    })\n    .ConfigureTaskHubWorker((context, builder) =\u003e\n    {\n        // add orchestration service\n        builder.WithOrchestrationService(new LocalOrchestrationService());\n\n        // add orchestration directly _not_ in service container. Will be treated as transient.\n        builder.AddOrchestration\u003cMyTransientOrchestration\u003e();\n\n        // will be fetched from service provider.\n        builder.AddOrchestration\u003cMySingletonOrchestration\u003e();\n\n        // will be fetched from service provider.\n        builder.UseOrchestrationMiddleware\u003cMyScopedMiddleware\u003e();\n\n        // same as orchestration: can be part of the services or not.\n        builder.AddActivity\u003cMyTransientActivity\u003e();\n    })\n    .RunConsoleAsync(); // starts the worker.\n```\n\nAll orchestrations, activities, and middleware will now be constructed via dependency injection.\n\n## Service Scope\n\nA new `IServiceScope` is created for the duration of every `OrchestrationInstance` run. This scope will be used for all actions, middleware, and the orchestration itself and disposed after both the middleware \u0026 orchestration pipeline has finished execution. Scopes are not preserved between runs of the same `OrchestrationInstance`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjviau%2Fdurabletask-hosting","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjviau%2Fdurabletask-hosting","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjviau%2Fdurabletask-hosting/lists"}