< Summary

Information
Class: Elsa.Workflows.Runtime.BackgroundWorkflowCancellationDispatcher
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/BackgroundWorkflowCancellationDispatcher.cs
Line coverage
20%
Covered lines: 1
Uncovered lines: 4
Coverable lines: 5
Total lines: 21
Line coverage: 20%
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%
DispatchAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/BackgroundWorkflowCancellationDispatcher.cs

#LineLine coverage
 1using Elsa.Mediator;
 2using Elsa.Mediator.Contracts;
 3using Elsa.Workflows.Runtime.Commands;
 4using Elsa.Workflows.Runtime.Requests;
 5using Elsa.Workflows.Runtime.Responses;
 6
 7namespace Elsa.Workflows.Runtime;
 8
 9/// <summary>
 10/// Dispatches workflow cancellation requests to a local background worker.
 11/// </summary>
 112public class BackgroundWorkflowCancellationDispatcher(ICommandSender commandSender) : IWorkflowCancellationDispatcher
 13{
 14    /// <inheritdoc />
 15    public async Task<DispatchCancelWorkflowsResponse> DispatchAsync(DispatchCancelWorkflowRequest request, Cancellation
 16    {
 017        var command = new CancelWorkflowsCommand(request);
 018        await commandSender.SendAsync(command, CommandStrategy.Background, cancellationToken);
 019        return new DispatchCancelWorkflowsResponse();
 020    }
 21}