Esempio n. 1
0
        public ClientListenerService(HazelcastClient client)
        {
            _client            = client;
            _connectionManager = client.GetConnectionManager();
            var eventTreadCount    = EnvironmentUtil.ReadInt("hazelcast.client.event.thread.count") ?? DefaultEventThreadCount;
            var eventQueueCapacity =
                EnvironmentUtil.ReadInt("hazelcast.client.event.queue.capacity") ?? DefaultEventQueueCapacity;

            _eventExecutor         = new StripedTaskScheduler(eventTreadCount, eventQueueCapacity, client.GetName() + ".event");
            _registrationScheduler = new StripedTaskScheduler(1, eventQueueCapacity, client.GetName() + ".eventRegistration");
            _registrations         = new ConcurrentDictionary <string, ListenerRegistration>();
            _eventHandlers         = new ConcurrentDictionary <long, DistributedEventHandler>();
            _failedRegistrations   = new ConcurrentDictionary <ClientConnection, ICollection <ListenerRegistration> >();
            IsSmart = client.GetClientConfig().GetNetworkConfig().IsSmartRouting();
        }