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
ILoggerFactoryThe logger factory to create an ILogger from
hybridCache
HybridCacheThe 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
TRequestThe incoming request.
next
RequestHandlerDelegate<TResponse>Awaitable delegate for the next action in the pipeline. Eventually this delegate represents the handler.
cancellationToken
CancellationTokenThe cancellation token.
Returns
- ValueTask<TResponse>
Awaitable task returning the
TResponse