< Summary

Information
Class: Elsa.Mediator.CommandStrategies.BackgroundStrategy
Assembly: Elsa.Mediator
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/CommandStrategies/BackgroundStrategy.cs
Line coverage
100%
Covered lines: 4
Uncovered lines: 0
Coverable lines: 4
Total lines: 19
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
ExecuteAsync()100%11100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/CommandStrategies/BackgroundStrategy.cs

#LineLine coverage
 1using Elsa.Mediator.Contexts;
 2using Elsa.Mediator.Contracts;
 3using Microsoft.Extensions.DependencyInjection;
 4
 5namespace Elsa.Mediator.CommandStrategies;
 6
 7/// <summary>
 8/// Invokes command handlers in the background and does not wait for the result.
 9/// </summary>
 10public class BackgroundStrategy : ICommandStrategy
 11{
 12    /// <inheritdoc />
 13    public async Task<TResult> ExecuteAsync<TResult>(CommandStrategyContext context)
 14    {
 2215        var commandsChannel = context.ServiceProvider.GetRequiredService<ICommandsChannel>();
 2216        await commandsChannel.Writer.WriteAsync(context.CommandContext, context.CancellationToken);
 2217        return default!;
 2218    }
 19}

Methods/Properties

ExecuteAsync()