private Result <ClusterStateInternal> Mutate(Func <ClusterStateInternal, Result <ClusterStateInternal> > mutation) { using var token = _lock.AcquireWriteLock(); var newClusterState = mutation(ClusterStateInternal); if (!newClusterState.Succeeded) { return(newClusterState); } ClusterStateInternal = newClusterState.Value !; return(ClusterStateInternal); }
private ClusterState(ClusterStateInternal clusterStateInternal) => ClusterStateInternal = clusterStateInternal;