3 Some interfaces that are used by the apt-dht classes.
7 from zope.interface import Interface
10 """An abstract interface for using a DHT implementation."""
12 def loadConfig(self, config):
13 """Load the DHTs configuration from a dictionary.
15 @type config: C{dictionary}
16 @param config: the dictionary of config values
19 def join(self, bootstrap_nodes):
20 """Bootstrap the new DHT node into the DHT.
22 @type bootstrap_nodes: C{list} of (C{string}, C{int})
23 @param bootstrap_nodes: a list of the nodes to contact to join the DHT
25 @return: a deferred that will fire when the node has joined
29 """Depart gracefully from the DHT.
32 @return: a deferred that will fire when the node has joined
35 def getValue(self, key):
36 """Get a value from the DHT for the specified key."""
38 def storeValue(self, key, value):
39 """Store a value in the DHT for the specified key."""