Esempio n. 1
0
        public ClusterEvents(ClusterState clusterState, ClusterMessaging clusterMessaging, ClusterMembers clusterMembers)
        {
            _clusterState     = clusterState;
            _clusterMessaging = clusterMessaging;
            _clusterMembers   = clusterMembers;

            _logger    = _clusterState.LoggerFactory.CreateLogger <ClusterEvents>();
            _scheduler = new DistributedEventScheduler(_clusterState.LoggerFactory);
        }
Esempio n. 2
0
        public ClusterEvents(ClusterState clusterState, ClusterMessaging clusterMessaging, TerminateConnections terminateConnections, ClusterMembers clusterMembers)
        {
            _clusterState     = clusterState;
            _clusterMessaging = clusterMessaging;
            _clusterMembers   = clusterMembers;

            _logger               = _clusterState.LoggerFactory.CreateLogger <ClusterEvents>();
            _scheduler            = new DistributedEventScheduler(_clusterState.LoggerFactory);
            _terminateConnections = terminateConnections;

            _objectLifecycleEventSubscription = new ObjectLifecycleEventSubscription(_clusterState, this)
            {
                ObjectCreated   = args => _objectCreated.AwaitEach(args),
                ObjectDestroyed = args => _objectDestroyed.AwaitEach(args)
            };

            _partitionLostEventSubscription = new PartitionLostEventSubscription(_clusterState, this, clusterMembers)
            {
                PartitionLost = args => _partitionLost.AwaitEach(args)
            };
        }