Пример #1
0
func (self remoteHashTree) SubDelTimestamp(key, subKey []radix.Nibble, subExpected int64) (changed bool) {
	data := HashTreeItem{
		Key:      key,
		SubKey:   subKey,
		Expected: subExpected,
	}
	op := "HashTree.SubDelTimestamp"
	if self.node.hasCommListeners() {
		self.node.triggerCommListeners(Comm{
			Key:         radix.Stitch(data.Key),
			SubKey:      radix.Stitch(data.SubKey),
			Source:      self.source,
			Destination: self.destination,
			Type:        op,
		})
	}
	self.destination.Call(op, data, &changed)
	return
}
Пример #2
0
func (self remoteHashTree) SubPutTimestamp(key, subKey []radix.Nibble, value []byte, present bool, subExpected, subTimestamp int64) (changed bool) {
	data := HashTreeItem{
		Key:       key,
		SubKey:    subKey,
		Value:     value,
		Exists:    present,
		Expected:  subExpected,
		Timestamp: subTimestamp,
	}
	op := "HashTree.SubPutTimestamp"
	if self.node.hasCommListeners() {
		self.node.triggerCommListeners(Comm{
			Key:         radix.Stitch(data.Key),
			SubKey:      radix.Stitch(data.SubKey),
			Source:      self.source,
			Destination: self.destination,
			Type:        op,
		})
	}
	self.destination.Call(op, data, &changed)
	return
}
Пример #3
0
func (self remoteHashTree) SubClearTimestamp(key []radix.Nibble, expected, timestamp int64) (deleted int) {
	data := HashTreeItem{
		Key:       key,
		Expected:  expected,
		Timestamp: timestamp,
	}
	op := "HashTree.SubClearTimestamp"
	if self.node.hasCommListeners() {
		self.node.triggerCommListeners(Comm{
			Key:         radix.Stitch(data.Key),
			Source:      self.source,
			Destination: self.destination,
			Type:        op,
		})
	}
	self.destination.Call(op, data, &deleted)
	return
}