Пример #1
0
        public ManagerElectionManager(string clusterName, string currentMemberId, ManagerElectionOptions options)
        {
            _currentMemberId = currentMemberId;
            var factory = new ManagerElectionFactory(clusterName, currentMemberId);

            _election = factory.Create(options);
        }
Пример #2
0
        public IManagerElection Create(ManagerElectionOptions options)
        {
            if (options == null || string.IsNullOrWhiteSpace(options.ManagerElectionClass))
            {
                return(new ConsulManagerElection(_clusterName, _currentMemberId));
            }

            throw new NotImplementedException("未实现自定义Manager选举类创建");
        }