reactor.callFromThread(self.callback,[])
## get value
- def goWithNodes(self, nodes):
+ def goWithNodes(self, nodes, found=None):
self.results = {}
+ if found:
+ for n in found:
+ self.results[n] = 1
for node in nodes:
if node.id == self.table.node.id:
continue
def valueForKey(self, key, callback):
""" returns the values found for key in global table """
nodes = self.table.findNodes(key)
- # create our search state
- state = GetValue(self, key, callback)
- reactor.callFromThread(state.goWithNodes, nodes)
-
+
# get locals
l = self.retrieveValues(key)
if len(l) > 0:
reactor.callFromThread(callback, l)
+ # create our search state
+ state = GetValue(self, key, callback)
+ reactor.callFromThread(state.goWithNodes, nodes, {'found' : l})
+
+
## async, but in the current implementation there is no guarantee a store does anything so there is no callback right now
def storeValueForKey(self, key, value, callback=None):