< Summary

Information
Class: Elsa.Workflows.Runtime.BookmarkQueueSignaler
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Services/BookmarkQueueSignaler.cs
Line coverage
100%
Covered lines: 12
Uncovered lines: 0
Coverable lines: 12
Total lines: 30
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%
AwaitAsync(...)100%11100%
TriggerAsync(...)100%11100%

File(s)

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

#LineLine coverage
 1using System.Threading.Channels;
 2
 3namespace Elsa.Workflows.Runtime;
 4
 5public class BookmarkQueueSignaler : IBookmarkQueueSignaler
 6{
 7    private readonly Channel<object?> _channel;
 8
 1409    public BookmarkQueueSignaler()
 10    {
 14011        var options = new BoundedChannelOptions(1)
 14012        {
 14013            SingleReader = true,
 14014            SingleWriter = false,
 14015            AllowSynchronousContinuations = false
 14016        };
 14017        _channel = Channel.CreateBounded<object?>(options);
 14018    }
 19
 20    public Task AwaitAsync(CancellationToken cancellationToken)
 21    {
 48522        return _channel.Reader.ReadAsync(cancellationToken).AsTask();
 23    }
 24
 25    public Task TriggerAsync(CancellationToken cancellationToken)
 26    {
 102627        _channel.Writer.TryWrite(null);
 102628        return Task.CompletedTask;
 29    }
 30}