示例#1
0
 public CachingContext(IConsumingContext <T> context, CacheConfiguration cacheConfiguration)
 {
     this.context            = context;
     this.cacheConfiguration = cacheConfiguration;
 }
示例#2
0
 public CachingConsumerOf(IConsumerOf <T> consumer, CacheConfiguration cacheConfiguration)
 {
     this.consumer           = consumer;
     this.cacheConfiguration = cacheConfiguration;
 }
示例#3
0
        private static MessageExchange TryCacheResponse(MessageExchange processedExchange, CacheConfiguration config)
        {
            if (!processedExchange.IsCompleteRequest)
            {
                return(processedExchange);
            }

            var ttl = GetTtl(config, processedExchange);

            if (ttl != null)
            {
                config.Cache.Set(processedExchange.Out, processedExchange.In.Payload, ttl.Value);
            }

            return(processedExchange);
        }