public void SetState(ClusterNodeState state, TimeSpan stateLifetime) { DateTime time = DateTime.Now + stateLifetime; _lock.ReadWrite( () => _state != state || time > _actualUntilTime, () => { _state = state; _actualUntilTime = time; } ); }
public void SetClusterNodeState(string clusterNodeKey, ClusterNodeState state, TimeSpan stateLifetime) { ClusterNodeInfo nodeInfo = _appServerNodes[clusterNodeKey]; nodeInfo.SetState(state, stateLifetime); }
public void SetClusterNodeState(byte cnid, ClusterNodeState state, TimeSpan stateLifetime) { ClusterNodeInfo nodeInfo = _appServerNodeMap[cnid % _appServerNodeMap.Length]; nodeInfo.SetState(state, stateLifetime); }