Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Node ¶
type Node struct { // Called when all dependencies are resolved. TrySendToTxnCache func(id cacheID) bool // Set the id generator to get a random ID. RandCacheID func() cacheID // Set the callback that the node is notified. OnNotified func(callback func()) // contains filtered or unexported fields }
Node is a node in the dependency graph used in conflict detection.
func (*Node) Free ¶
func (n *Node) Free()
Free implements interface internal.SlotNode. It must be called if a node is no longer used. We are using sync.Pool to lessen the burden of GC.
type SlotNode ¶
type SlotNode[T any] interface { // NodeID tells the node's ID. NodeID() int64 // Hashs returns the sorted and deduped hashes of the node. Hashes() []uint64 // Construct a dependency on `others`. DependOn(dependencyNodes map[int64]T, noDependencyKeyCnt int) // Remove the node itself and notify all dependers. Remove() // Free the node itself and remove it from the graph. Free() }
SlotNode describes objects that can be compared for equality.
type Slots ¶
type Slots[E SlotNode[E]] struct { // contains filtered or unexported fields }
Slots implements slot-based conflict detection. It holds references to E, which can be used to build a DAG of dependency.
Click to show internal directories.
Click to hide internal directories.