Пример #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Conn"/> class.
        /// </summary>
        public Conn(string addr, Config config, IConnDelegate connDelegate)
        {
            if (string.IsNullOrEmpty(addr))
            {
                throw new ArgumentNullException("addr");
            }
            if (config == null)
            {
                throw new ArgumentNullException("config");
            }
            if (connDelegate == null)
            {
                throw new ArgumentNullException("connDelegate");
            }

            _addr = addr;

            _config   = config.Clone();
            _delegate = connDelegate;

            _maxRdyCount      = 2500;
            _lastMsgTimestamp = DateTime.Now.UnixNano();

            _cmdChan         = new Chan <Command>();
            _msgResponseChan = new Chan <msgResponse>();
            _exitChan        = new Chan <int>();
            _drainReady      = new Chan <int>();
        }
Пример #2
0
 public MockProducerConn(IConnDelegate connDelegate)
 {
     _connDelegate = connDelegate;
     _closeCh      = new Chan <bool>();
     _pubCh        = new Chan <bool>();
     GoFunc.Run(router, "ProducerTest:router");
 }
Пример #3
0
 public MockProducerConn(IConnDelegate connDelegate)
 {
     _connDelegate = connDelegate;
     _closeCh = new Chan<bool>();
     _pubCh = new Chan<bool>();
     GoFunc.Run(router, "ProducerTest:router");
 }
Пример #4
0
        /// <summary>
        /// Initializes a new instance of the <see cref="Conn"/> class.
        /// </summary>
        public Conn(string addr, Config config, IConnDelegate connDelegate)
        {
            if (string.IsNullOrEmpty(addr))
                throw new ArgumentNullException("addr");
            if (config == null)
                throw new ArgumentNullException("config");
            if (connDelegate == null)
                throw new ArgumentNullException("connDelegate");

            _addr = addr;

            _config = config.Clone();
            _delegate = connDelegate;

            _maxRdyCount = 2500;
            _lastMsgTimestamp = DateTime.Now.UnixNano();

            _cmdChan = new Chan<Command>();
            _msgResponseChan = new Chan<msgResponse>();
            _exitChan = new Chan<int>();
            _drainReady = new Chan<int>();
        }