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.
type Slots ¶
type Slots struct {
// contains filtered or unexported fields
}
Slots implements slot-based conflict detection. It holds references to Node, which can be used to build a DAG of dependency.
func (*Slots) AllocNode ¶
AllocNode allocates a new node and initializes it with the given hashes. TODO: reuse node if necessary. Currently it's impossible if async-notify is used. The reason is a node can step functions `assignTo`, `Remove`, `free`, then `assignTo`. again. In the last `assignTo`, it can never know whether the node has been reused or not.
Click to show internal directories.
Click to hide internal directories.