Last active
December 25, 2021 10:36
-
-
Save samueleresca/d8d55cb34f10c8c143c0c9fccb1e0c54 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// NewQuorumSystemWithReads defines a new quorum system given a read Expr, the write Expr is derived using DualOperator.Dual operation. | |
func NewQuorumSystemWithReads(reads Expr) QuorumSystem { | |
qs, _ := NewQuorumSystem(reads, reads.Dual()) | |
qs.nameToNode = nameToNode{} | |
for node := range qs.GetNodes() { | |
qs.nameToNode[node.Name] = node | |
} | |
return qs | |
} | |
// NewQuorumSystemWithWrites defines a new quorum system given a write Expr, the read Expr is derived using DualOperator.Dual operation. | |
func NewQuorumSystemWithWrites(writes Expr) QuorumSystem { | |
... | |
} | |
// NewQuorumSystem defines a new quorum system given the reads Expr and the writes Expr. | |
func NewQuorumSystem(reads Expr, writes Expr) (QuorumSystem, error) { | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment