示例#1
0
        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);
        }
示例#2
0
 private ClusterState(ClusterStateInternal clusterStateInternal) => ClusterStateInternal = clusterStateInternal;