Inheritance: IMessageCallback
示例#1
0
        public void Receive(IReceiver receiver)
        {
            while (!_disposed)
            {
                foreach (var data in _queue.GetConsumingEnumerable())
                {
                    using (var stream = new MemoryStream(data))
                    {
                        var token = _formatter.Deserialize(stream).As<EnvelopeToken>();

                        var callback = new InMemoryCallback(this, token);

                        receiver.Receive(token.Data, token.Headers, callback);
                    }
                }
            }
        }
示例#2
0
        public void Receive(IReceiver receiver)
        {
            while (!_disposed)
            {
                foreach (var data in _queue.GetConsumingEnumerable())
                {
                    using (var stream = new MemoryStream(data))
                    {
                        var token = _formatter.Deserialize(stream).As <EnvelopeToken>();

                        var callback = new InMemoryCallback(this, token);

                        receiver.Receive(token.Data, token.Headers, callback);
                    }
                }
            }
        }