< Summary

Information
Class: Elsa.Mediator.PublishingStrategies.ParallelProcessingStrategy
Assembly: Elsa.Mediator
File(s): /home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/PublishingStrategies/ParallelProcessingStrategy.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 23
Line coverage: 0%
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
PublishAsync()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/common/Elsa.Mediator/PublishingStrategies/ParallelProcessingStrategy.cs

#LineLine coverage
 1using Elsa.Mediator.Contexts;
 2using Elsa.Mediator.Contracts;
 3using Elsa.Mediator.Extensions;
 4
 5namespace Elsa.Mediator.PublishingStrategies;
 6
 7/// <summary>
 8/// Invokes event handlers in parallel and waits for the result.
 9/// </summary>
 10public class ParallelProcessingStrategy : IEventPublishingStrategy
 11{
 12    /// <inheritdoc />
 13    public async Task PublishAsync(NotificationStrategyContext context)
 14    {
 015        var notificationContext = context.NotificationContext;
 016        var notification = notificationContext.Notification;
 017        var notificationType = notification.GetType();
 018        var handleMethod = notificationType.GetNotificationHandlerMethod();
 019        var tasks = context.Handlers.Select(handler => handler.InvokeAsync(handleMethod, context.NotificationContext)).T
 20
 021        await Task.WhenAll(tasks);
 022    }
 23}

Methods/Properties

PublishAsync()