< Summary

Information
Class: Elsa.Workflows.Runtime.Distributed.Features.DistributedRuntimeFeature
Assembly: Elsa.Workflows.Runtime.Distributed
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime.Distributed/Features/DistributedRuntimeFeature.cs
Line coverage
100%
Covered lines: 16
Uncovered lines: 0
Coverable lines: 16
Total lines: 43
Line coverage: 100%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor(...)100%11100%
Configure()100%11100%
Apply()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime.Distributed/Features/DistributedRuntimeFeature.cs

#LineLine coverage
 1using Elsa.Common;
 2using Elsa.Extensions;
 3using Elsa.Features.Abstractions;
 4using Elsa.Features.Attributes;
 5using Elsa.Features.Services;
 6using Elsa.Resilience.Features;
 7using Elsa.Workflows.Runtime.Distributed.StartupTasks;
 8using Elsa.Workflows.Runtime.Features;
 9using Microsoft.Extensions.DependencyInjection;
 10using Microsoft.Extensions.DependencyInjection.Extensions;
 11
 12namespace Elsa.Workflows.Runtime.Distributed.Features;
 13
 14/// <summary>
 15/// Installs and configures workflow runtime features.
 16/// </summary>
 17[DependsOn(typeof(WorkflowRuntimeFeature))]
 18[DependsOn(typeof(ResilienceFeature))]
 519public class DistributedRuntimeFeature(IModule module) : FeatureBase(module)
 20{
 21    public override void Configure()
 22    {
 523        Module.UseWorkflowRuntime(runtime =>
 524        {
 35525            runtime.WorkflowRuntime = sp => sp.GetRequiredService<DistributedWorkflowRuntime>();
 726            runtime.BookmarkQueueWorker = sp => sp.GetRequiredService<DistributedBookmarkQueueWorker>();
 1027        });
 528    }
 29
 30    /// <inheritdoc />
 31    public override void Apply()
 32    {
 533        Services
 534            .AddScoped<DistributedWorkflowRuntime>()
 535            .AddScoped<DistributedBookmarkQueueWorker>()
 536
 537            .Decorate<IWorkflowDefinitionsRefresher, DistributedWorkflowDefinitionsRefresher>()
 538            .Decorate<IWorkflowDefinitionsReloader, DistributedWorkflowDefinitionsReloader>();
 39
 540        Services.TryAddScoped<DistributedRuntimeLockProviderValidator>();
 541        Services.TryAddEnumerable(ServiceDescriptor.Scoped<IStartupTask, ValidateDistributedRuntimeLockProviderStartupTa
 542    }
 43}