You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
- using HealthMonitor.Core.Pipeline.Aop;
-
- namespace HealthMonitor.Core.Pipeline
- {
- public class AopCachePipeline : IPipeline<CacheInterceptorContext>
- {
- private readonly IList<IValue<CacheInterceptorContext>> _values;
-
- public AopCachePipeline()
- {
- _values = new List<IValue<CacheInterceptorContext>>();
- }
-
- public void AddValue(IValue<CacheInterceptorContext> v)
- {
- var lastValue = _values.LastOrDefault();
- if (lastValue != null) lastValue.Next = v;
- _values.Add(v);
- }
-
- public async Task Start(CacheInterceptorContext context)
- {
- try
- {
- var firstValue = _values.FirstOrDefault();
- if (firstValue != null) await firstValue.Invoke(context);
- }
- catch (AssertValidException)
- {
- await context.AopDelegate(context.AopContext);
- }
- }
- }
- }
|