Example #1
0
        /// <summary>
        /// Leave the channel.
        /// </summary>
        /// <param name="asReader">true</param>
        /// <c>false</c>
        public Task LeaveAsync(bool asReader)
        {
            // TODO: We should wait?

            NetworkConfig.TransmitRequest(new PendingNetworkRequest(m_attribute.Name, typeof(T), NetworkMessageType.LeaveRequest, asReader));
            return(Task.FromResult(true));
        }
Example #2
0
        /// <summary>
        /// Stops this channel from processing messages
        /// </summary>
        /// <param name="immediate">Retires the channel without processing the queue, which may cause lost messages</param>
        public Task RetireAsync(bool immediate)
        {
            // TODO: We should wait?
            // TODO: We should propagate the state back

            NetworkConfig.TransmitRequest(new PendingNetworkRequest(m_attribute.Name, typeof(T), NetworkMessageType.RetireRequest, immediate));
            m_isRetired = true;

            return(Task.FromResult(true));
        }