public IpcMessageListener()
        {
            var config = Catalog.Factory.Resolve <IConfig>(SpecialFactoryContexts.Routed);

            _q   = new MemoryMappedTransferInbox(config[MessageListenerLocalConfig.QueueName]);
            _req = new MemoryMappedTransferOutbox(config[MessageListenerLocalConfig.QueueName]);
            _cts = new CancellationTokenSource();
        }
        public void Send <T>(T msg, string routeKey)
        {
            RefreshQueues();

            var matchingQueues = MessageExchangeDeclaration.BindMessageToQueues(routeKey, _exchangeType, _queues);

            foreach (var q in matchingQueues)
            {
                using (var outbox = new MemoryMappedTransferOutbox(q))
                {
                    outbox.Enqueue(new MessageQueueEnvelope(msg));
                    outbox.Send();
                }
            }
        }