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

Information
Class: AsyncResponse.Channels.Redis.RedisAsyncResponseOptions
Assembly: AsyncResponse.Channels.Redis
File(s): /_/src/Channels/AsyncResponse.Channels.Redis/RedisAsyncResponseOptions.cs
Line coverage
100%
Covered lines: 5
Uncovered lines: 0
Coverable lines: 5
Total lines: 37
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
get_KeyPrefix()100%11100%
Validate()100%22100%

File(s)

/_/src/Channels/AsyncResponse.Channels.Redis/RedisAsyncResponseOptions.cs

#LineLine coverage
 1namespace AsyncResponse.Channels.Redis;
 2
 3/// <summary>
 4/// Options for the Redis async-response channel. Recovery-state expiry, default timeout, and the
 5/// remote stack-trace policy are inherited from <see cref="DurableAsyncResponseChannelOptions"/>.
 6/// </summary>
 7public sealed class RedisAsyncResponseOptions : DurableAsyncResponseChannelOptions
 8{
 9    /// <summary>
 10    /// Prefix for every Redis key and pub/sub channel created by the channel:
 11    /// response channels are <c>{KeyPrefix}:response:{correlationId}</c> and recovery state lives
 12    /// at <c>{KeyPrefix}:recovery:{correlationId}</c>. Change it to isolate multiple
 13    /// applications or environments sharing one Redis. Treat as a deployment-wide contract:
 14    /// publishers and subscribers must agree on it, and changing it orphans existing
 15    /// recovery state.
 16    /// </summary>
 222017    public string KeyPrefix { get; set; } = "asyncresponse";
 18
 19    /// <summary>
 20    /// Validates the options, throwing <see cref="InvalidOperationException"/> on a
 21    /// misconfiguration. Called by the channel so a bad configuration fails fast rather than at
 22    /// first use.
 23    /// </summary>
 24    public void Validate()
 25    {
 26        // Shared channel knobs (RecoveryStateExpiry, DefaultTimeout, DisposalDrainTimeout) go
 27        // through the ONE base guard set.
 55828        ValidateShared(nameof(RedisAsyncResponseOptions));
 29
 30        // Sibling-channel parity: RemoteStackTrace.Cap treats any non-positive cap as "leave the
 31        // trace unchanged", so a negative value (a plausible "unlimited", or a bad configuration
 32        // binding) silently disabled the DoS bound in both directions. The other four channels
 33        // reject it at startup; Redis was the only one that accepted it.
 55834        if (MaxRemoteStackTraceLength < 0)
 235            throw new InvalidOperationException($"{nameof(RedisAsyncResponseOptions)}.{nameof(MaxRemoteStackTraceLength)
 55636    }
 37}

Methods/Properties

get_KeyPrefix()
Validate()