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