Exemple #1
0
        public Task<IListener> CreateListenerAsync(ListenerFactoryContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException(nameof(context));
            }

            IListener listener;

            if (_attribute.Mode == Mode.PubSub)
            {
                listener = new RedisChannelListener(_configuration, _attribute, context.Executor);
            }
            else
            {
                listener = new RedisCacheListener(_configuration, _attribute, context.Executor);
            }
            return Task.FromResult(listener);
        }
Exemple #2
0
        public Task <IListener> CreateListenerAsync(ListenerFactoryContext context)
        {
            if (context == null)
            {
                throw new ArgumentNullException("context");
            }

            IListener listener;

            if (_mode == Mode.PubSub)
            {
                listener = new RedisChannelListener(_channelOrKey, context.Executor, _config, _trace);
            }
            else
            {
                listener = new RedisCacheListener(_channelOrKey, context.Executor, _config, _trace);
            }
            return(Task.FromResult(listener));
        }