Пример #1
0
        public Task WriteAsync(object message)
        {
            var next = FindContextOutbound();

            ReferenceCountUtil.Touch(message, next);
            return(next.Invoker.InvokeWriteAsync(next, message));
        }
Пример #2
0
        public Task WriteAsync(object msg) // todo: cancellationToken?
        {
            AbstractChannelHandlerContext target = this.FindContextOutbound();

            ReferenceCountUtil.Touch(msg, target);
            return(target.Invoker.InvokeWriteAsync(target, msg));
        }
Пример #3
0
        public IChannelHandlerContext FireChannelRead(object message)
        {
            var next = FindContextInbound();

            ReferenceCountUtil.Touch(message, next);
            next.Invoker.InvokeChannelRead(next, message);
            return(this);
        }
Пример #4
0
 public override IReferenceCounted Touch(object hint)
 {
     foreach (IRedisMessage message in this.Children)
     {
         ReferenceCountUtil.Touch(message);
     }
     return(this);
 }
Пример #5
0
        public IChannelHandlerContext FireChannelRead(object msg)
        {
            AbstractChannelHandlerContext target = this.FindContextInbound();

            ReferenceCountUtil.Touch(msg, target);
            target.Invoker.InvokeChannelRead(target, msg);
            return(this);
        }
Пример #6
0
        public Task WriteAndFlushAsync(object message)
        {
            var target = FindContextOutbound();

            ReferenceCountUtil.Touch(message, target);
            var writeTask = target.Invoker.InvokeWriteAsync(target, message);

            target = FindContextOutbound();
            target.Invoker.InvokeFlush(target);
            return(writeTask);
        }
Пример #7
0
        public Task WriteAndFlushAsync(object message) // todo: cancellationToken?
        {
            AbstractChannelHandlerContext target;

            target = this.FindContextOutbound();
            ReferenceCountUtil.Touch(message, target);
            Task writeFuture = target.Invoker.InvokeWriteAsync(target, message);

            target = this.FindContextOutbound();
            target.Invoker.InvokeFlush(target);
            return(writeFuture);
        }
Пример #8
0
        /// <summary>
        /// Read data from the outbound. This may return <c>null</c> if nothing is readable.
        /// </summary>
        public T ReadOutbound <T>()
        {
#if DEBUG
            var message = (T)Poll(_outboundMessages);
            if (message is object)
            {
                _ = ReferenceCountUtil.Touch(message, "Caller of readOutbound() will handle the message from this point.");
            }
            return(message);
#else
            return((T)Poll(_outboundMessages));
#endif
        }
Пример #9
0
        /// <summary>
        /// Return received data from this <see cref="IChannel"/>.
        /// </summary>
        public object ReadInbound()
        {
#if DEBUG
            var message = Poll(_inboundMessages);
            if (message is object)
            {
                _ = ReferenceCountUtil.Touch(message, "Caller of readInbound() will handle the message from this point");
            }
            return(message);
#else
            return(Poll(_inboundMessages));
#endif
        }
Пример #10
0
 internal object Touch(object msg, AbstractChannelHandlerContext next) => this.touch ? ReferenceCountUtil.Touch(msg, next) : msg;
 public virtual IReferenceCounted Touch(object hint)
 {
     ReferenceCountUtil.Touch(this.Content, hint);
     return(this);
 }
Пример #12
0
 internal object Touch(object msg, FABHandlerContext next)
 {
     return(this.touch == true?ReferenceCountUtil.Touch(msg, next) : msg);
 }
Пример #13
0
 public IReferenceCounted Touch()
 {
     ReferenceCountUtil.Touch(this.Content);
     return(this);
 }
Пример #14
0
 public virtual IReferenceCounted Touch()
 {
     _ = ReferenceCountUtil.Touch(Content);
     return(this);
 }