Ejemplo n.º 1
0
 public MemQueueSpecifier(MemMessageBus parent, MessageExchangeDeclaration declSpec,
                          MessageQueueDeclaration queueSpec)
 {
     _parent     = parent;
     _declSpec   = declSpec;
     _queueSpec  = queueSpec;
     _queueEvent = new ManualResetEventSlim(false);
 }
Ejemplo n.º 2
0
        public MemMessagePublisher()
        {
            var cfg = Catalog.Factory.Resolve <IConfig>(SpecialFactoryContexts.Routed);

            _exchangeName = cfg[MessagePublisherLocalConfig.ExchangeName];

            _bus = MemMessageBus.Instance();
        }
Ejemplo n.º 3
0
        public MemMessageListener()
        {
            var config = Catalog.Factory.Resolve <IConfig>(SpecialFactoryContexts.Routed);
            var exName = config[MessageListenerLocalConfig.ExchangeName];
            var qName  = config[MessageListenerLocalConfig.QueueName];

            _bus = MemMessageBus.Instance();
            var qs = _bus.SpecifyExchange(exName).SpecifyQueue(qName);

            _q   = ((IMemQueueAccess)qs).Queue;
            _sev = ((IMemQueueAccess)qs).SentEvent;
            _cts = new CancellationTokenSource();
        }
Ejemplo n.º 4
0
        public static MemMessageBus Instance()
        {
            if (null == _instance)
            {
                lock (InitLock)
                {
                    if (null == _instance)
                    {
                        _instance = new MemMessageBus();
                    }
                }
            }

            return(_instance);
        }
Ejemplo n.º 5
0
 internal MemExchange(MemMessageBus parent, MessageExchangeDeclaration declSpec)
 {
     _parent   = parent;
     _declSpec = declSpec;
 }