< Summary

Information
Class: Elsa.Workflows.Runtime.RateLimitedFuncExtensions
Assembly: Elsa.Workflows.Runtime
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/RateLimitedFuncExtensions.cs
Line coverage
50%
Covered lines: 4
Uncovered lines: 4
Coverable lines: 8
Total lines: 31
Line coverage: 50%
Branch coverage
50%
Covered branches: 2
Total branches: 4
Branch coverage: 50%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
InvokeAsync()0%620%
InvokeAsync()100%22100%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Workflows.Runtime/Extensions/RateLimitedFuncExtensions.cs

#LineLine coverage
 1using ThrottleDebounce;
 2
 3namespace Elsa.Workflows.Runtime;
 4
 5/// <summary>
 6/// Adds extension methods for <see cref="RateLimitedFunc{TResult}"/> and <see cref="RateLimitedFunc{T, TResult}"/>.
 7/// </summary>
 8public static class RateLimitedFuncExtensions
 9{
 10    /// <summary>
 11    /// Invokes the specified rate limited function.
 12    /// </summary>
 13    public static async Task InvokeAsync(this RateLimitedFunc<Task> rateLimitedFunc)
 14    {
 015        var task = rateLimitedFunc.Invoke();
 16
 017        if (task != null)
 018            await task;
 019    }
 20
 21    /// <summary>
 22    /// Invokes the specified rate limited function.
 23    /// </summary>
 24    public static async Task InvokeAsync<T>(this RateLimitedFunc<T, Task> rateLimitedFunc, T arg1)
 25    {
 48026        var task = rateLimitedFunc.Invoke(arg1);
 27
 48028        if (task != null)
 48029            await task;
 48030    }
 31}

Methods/Properties

InvokeAsync()
InvokeAsync()