| | | 1 | | using CShells.Features; |
| | | 2 | | using Elsa.Common; |
| | | 3 | | using Elsa.Extensions; |
| | | 4 | | using Elsa.Workflows.Runtime.Distributed.StartupTasks; |
| | | 5 | | using JetBrains.Annotations; |
| | | 6 | | using Microsoft.Extensions.DependencyInjection; |
| | | 7 | | using Microsoft.Extensions.DependencyInjection.Extensions; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Workflows.Runtime.Distributed.ShellFeatures; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Installs and configures distributed workflow runtime features. |
| | | 13 | | /// </summary> |
| | | 14 | | [ShellFeature( |
| | | 15 | | DisplayName = "Distributed Runtime", |
| | | 16 | | Description = "Provides distributed workflow runtime capabilities", |
| | | 17 | | DependsOn = ["WorkflowRuntime", "Resilience"])] |
| | | 18 | | [UsedImplicitly] |
| | | 19 | | public class DistributedRuntimeFeature : IShellFeature |
| | | 20 | | { |
| | | 21 | | public void ConfigureServices(IServiceCollection services) |
| | | 22 | | { |
| | 0 | 23 | | services |
| | 0 | 24 | | .AddScoped<DistributedWorkflowRuntime>() |
| | 0 | 25 | | .AddScoped<IWorkflowRuntime>(sp => sp.GetRequiredService<DistributedWorkflowRuntime>()) |
| | 0 | 26 | | .AddScoped<DistributedBookmarkQueueWorker>() |
| | 0 | 27 | | .AddScoped<IBookmarkQueueWorker>(sp => sp.GetRequiredService<DistributedBookmarkQueueWorker>()); |
| | | 28 | | |
| | 0 | 29 | | services.TryAddScoped<DistributedRuntimeLockProviderValidator>(); |
| | 0 | 30 | | services.TryAddEnumerable(ServiceDescriptor.Scoped<IStartupTask, ValidateDistributedRuntimeLockProviderStartupTa |
| | 0 | 31 | | } |
| | | 32 | | } |