Exemplo n.º 1
0
        public ProducerChannel(string uri, bool isReliable, bool isInOrder)
        {
            Uri = uri;
            IsReliable = isReliable;
            IsInOrder = isInOrder;

            Buffer = new ChannelBuffer();
            _isOpen = new ThreadSafe.Boolean(false);
        }
 public RemoteConfigLongPollService()
 {
     m_longPollFailSchedulePolicyInSecond = new ExponentialSchedulePolicy(1, 120);    //in second
     m_longPollSuccessSchedulePolicyInMS  = new ExponentialSchedulePolicy(100, 1000); //in millisecond
     m_longPollingStarted = new ThreadSafe.Boolean(false);
     m_longPollingStopped = new ThreadSafe.Boolean(false);
     m_longPollNamespaces = new ConcurrentDictionary <string, ISet <RemoteConfigRepository> >();
     m_notifications      = new ConcurrentDictionary <string, long?>();
 }
Exemplo n.º 3
0
 public EndpointSession(DefaultEndpointClient client)
 {
     this.client = client;
     this.flushing = new ThreadSafe.Boolean(false);
     this.closed = new ThreadSafe.Boolean(false);
     this.flushingOp = new ThreadSafe.AtomicReference<WriteOp>(null);
     this.sessionFuture = new ThreadSafe.AtomicReference<IConnectFuture>(null);
     this.opQueue = new BlockingQueue<WriteOp>(client.Config.EndpointSessionSendBufferSize);
     
 }
Exemplo n.º 4
0
        private readonly ConcurrentDictionary <string, ApolloNotificationMessages> _remoteNotificationMessages; //namespaceName -> watchedKey -> notificationId

        public RemoteConfigLongPollService(ConfigServiceLocator serviceLocator, HttpUtil httpUtil, IApolloOptions configUtil)
        {
            _serviceLocator = serviceLocator;
            _httpUtil       = httpUtil;
            _options        = configUtil;
            _longPollFailSchedulePolicyInSecond = new ExponentialSchedulePolicy(1, 120);    //in second
            _longPollSuccessSchedulePolicyInMs  = new ExponentialSchedulePolicy(100, 1000); //in millisecond
            _longPollingStarted         = new ThreadSafe.Boolean(false);
            _longPollingStopped         = new ThreadSafe.Boolean(false);
            _longPollNamespaces         = new ConcurrentDictionary <string, ISet <RemoteConfigRepository> >();
            _notifications              = new ConcurrentDictionary <string, long?>();
            _remoteNotificationMessages = new ConcurrentDictionary <string, ApolloNotificationMessages>();
        }
Exemplo n.º 5
0
        protected AbstractConsumer(IConsumerBuffer buffer)
        {
            Guard.ArgumentNotNull(buffer, buffer.GetType().FullName);
            Buffer = buffer;

            _cts = new CancellationTokenSource();
            _threadPool = new ThreadPool();
            _isTaskStart = new ThreadSafe.Boolean(false);
            
            ConfigUtil.Instance.NotifyPropertyChange += OnNotifyPropertyChange;
#if DEBUG
            this.debugLog = ObjectFactory.Current.Get<IDebugLogWriter>(Lifetime.ContainerControlled);
#endif 
        }
Exemplo n.º 6
0
 public DefaultConfig(IDataRepository configRepository, ILogger <DefaultConfig> logger)
 {
     _configRepository = configRepository;
     _logger           = logger;
     _loaded           = new ThreadSafe.Boolean(false);
 }
Exemplo n.º 7
0
 public DefaultErrorCode(IDataRepository dataRepository)
 {
     _dataRepository = dataRepository;
     _loaded         = new ThreadSafe.Boolean(false);
 }