| | | 1 | | using Elsa.Extensions; |
| | | 2 | | using Elsa.Features.Abstractions; |
| | | 3 | | using Elsa.Features.Attributes; |
| | | 4 | | using Elsa.Features.Services; |
| | | 5 | | using Elsa.Resilience.Features; |
| | | 6 | | using Elsa.Workflows.Runtime.Features; |
| | | 7 | | using Microsoft.Extensions.DependencyInjection; |
| | | 8 | | |
| | | 9 | | namespace Elsa.Workflows.Runtime.Distributed.Features; |
| | | 10 | | |
| | | 11 | | /// <summary> |
| | | 12 | | /// Installs and configures workflow runtime features. |
| | | 13 | | /// </summary> |
| | | 14 | | [DependsOn(typeof(WorkflowRuntimeFeature))] |
| | | 15 | | [DependsOn(typeof(ResilienceFeature))] |
| | 9 | 16 | | public class DistributedRuntimeFeature(IModule module) : FeatureBase(module) |
| | | 17 | | { |
| | | 18 | | public override void Configure() |
| | | 19 | | { |
| | 9 | 20 | | Module.UseWorkflowRuntime(runtime => |
| | 9 | 21 | | { |
| | 486 | 22 | | runtime.WorkflowRuntime = sp => sp.GetRequiredService<DistributedWorkflowRuntime>(); |
| | 11 | 23 | | runtime.BookmarkQueueWorker = sp => sp.GetRequiredService<DistributedBookmarkQueueWorker>(); |
| | 18 | 24 | | }); |
| | 9 | 25 | | } |
| | | 26 | | |
| | | 27 | | /// <inheritdoc /> |
| | | 28 | | public override void Apply() |
| | | 29 | | { |
| | 9 | 30 | | Services |
| | 9 | 31 | | .AddScoped<DistributedWorkflowRuntime>() |
| | 9 | 32 | | .AddScoped<DistributedBookmarkQueueWorker>(); |
| | 9 | 33 | | } |
| | | 34 | | } |