< Summary - AsyncResponse (Release / net8.0+net10.0 / unit+integration)

Information
Class: AsyncResponse.InMemoryAsyncResponseOptions
Assembly: AsyncResponse.Core
File(s): /_/src/AsyncResponse.Core/InMemoryAsyncResponseOptions.cs
Line coverage
100%
Covered lines: 7
Uncovered lines: 0
Coverable lines: 7
Total lines: 34
Line coverage: 100%
Branch coverage
100%
Covered branches: 2
Total branches: 2
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
.ctor()100%11100%
Validate()100%22100%

File(s)

/_/src/AsyncResponse.Core/InMemoryAsyncResponseOptions.cs

#LineLine coverage
 1namespace AsyncResponse;
 2
 3/// <summary>
 4/// Options for the process-local response channel registered by
 5/// <c>AddAsyncResponse().WithInMemoryChannel()</c>. Waiters, subscriptions, and recovery state
 6/// all live in memory and disappear when the process exits.
 7/// </summary>
 8// Derives from the DURABLE options despite holding nothing durable: the wire channels serialize
 9// failures (message + capped stack trace, type erased), and the in-memory channel reproduces that
 10// so tests exercise the same failure shape production sees — including these two policy knobs.
 11public sealed class InMemoryAsyncResponseOptions : DurableAsyncResponseChannelOptions
 12{
 13    /// <summary>Runs the InMemoryAsyncResponseOptions operation.</summary>
 131014    public InMemoryAsyncResponseOptions()
 15    {
 16        // Process-local recovery state is not durable (entries are lost on exit), so a short default
 17        // keeps stale state from lingering — unlike the durable channels' 7-day default.
 131018        RecoveryStateExpiry = TimeSpan.FromMinutes(30);
 131019    }
 20
 21    /// <summary>
 22    /// Validates the options, throwing an actionable <see cref="InvalidOperationException"/> on
 23    /// misconfiguration — the same guard set every durable channel applies, so a configuration
 24    /// that passes the in-memory harness cannot fail host startup on a real channel.
 25    /// </summary>
 26    internal void Validate()
 27    {
 127428        ValidateShared(nameof(InMemoryAsyncResponseOptions));
 29        // RemoteStackTrace.Cap treats a non-positive cap as "no cap", so without this the bound
 30        // on remote traces was silently disabled here while all five wire channels reject it.
 127031        if (MaxRemoteStackTraceLength < 0)
 232            throw new InvalidOperationException($"{nameof(InMemoryAsyncResponseOptions)}.{nameof(MaxRemoteStackTraceLeng
 126833    }
 34}

Methods/Properties

.ctor()
Validate()