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); } } } }
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); } } } }