Table of Contents

Class HybridCacheExpireBehavior<TRequest, TResponse>

Namespace
Arbiter.CommandQuery.Behaviors
Assembly
Arbiter.CommandQuery.dll

A behavior for removing a cache tag of the response from HybridCache. TRequest must implement ICacheExpire for the cached tag.

public class HybridCacheExpireBehavior<TRequest, TResponse> : PipelineBehaviorBase<TRequest, TResponse>, IPipelineBehavior<TRequest, TResponse> where TRequest : class, IRequest<TResponse>

Type Parameters

TRequest

The type of the request.

TResponse

The type of the response.

Inheritance
PipelineBehaviorBase<TRequest, TResponse>
HybridCacheExpireBehavior<TRequest, TResponse>
Implements
IPipelineBehavior<TRequest, TResponse>
Inherited Members

Constructors

HybridCacheExpireBehavior(ILoggerFactory, HybridCache)

Initializes a new instance of the HybridCacheExpireBehavior<TRequest, TResponse> class.

public HybridCacheExpireBehavior(ILoggerFactory loggerFactory, HybridCache hybridCache)

Parameters

loggerFactory ILoggerFactory

The logger factory to create an ILogger from

hybridCache HybridCache

The hybrid cache.

Exceptions

ArgumentNullException

When hybridCache is null

Methods

Process(TRequest, RequestHandlerDelegate<TResponse>, CancellationToken)

Processes the specified request with the additional behavior.

protected override ValueTask<TResponse?> Process(TRequest request, RequestHandlerDelegate<TResponse> next, CancellationToken cancellationToken)

Parameters

request TRequest

The incoming request.

next RequestHandlerDelegate<TResponse>

Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.

cancellationToken CancellationToken

The cancellation token.

Returns

ValueTask<TResponse>

Awaitable task returning the TResponse