X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=apt_dht%2Finterfaces.py;h=446cd02f99cc6bb05977d26735537759f81531a3;hb=21f93f967869efe321e2162b458aa22fd836da68;hp=c6bea9d50b49b8e808c3be93cfacdf8a2a5d1cb1;hpb=841813702444e1f7f975e83441b0dd04015413a1;p=quix0rs-apt-p2p.git diff --git a/apt_dht/interfaces.py b/apt_dht/interfaces.py index c6bea9d..446cd02 100644 --- a/apt_dht/interfaces.py +++ b/apt_dht/interfaces.py @@ -9,31 +9,33 @@ from zope.interface import Interface class IDHT(Interface): """An abstract interface for using a DHT implementation.""" - def loadConfig(self, config): + def loadConfig(self, config, section): """Load the DHTs configuration from a dictionary. - @type config: C{dictionary} + @type config: C{SafeConfigParser} @param config: the dictionary of config values """ - def join(self, bootstrap_nodes): + def join(self): """Bootstrap the new DHT node into the DHT. - @type bootstrap_nodes: C{list} of (C{string}, C{int}) - @param bootstrap_nodes: a list of the nodes to contact to join the DHT - @rtype: C{Deffered} + @rtype: C{Deferred} @return: a deferred that will fire when the node has joined """ def leave(self): """Depart gracefully from the DHT. - @rtype: C{Deffered} - @return: a deferred that will fire when the node has joined + @rtype: C{Deferred} + @return: a deferred that will fire when the node has left """ def getValue(self, key): - """Get a value from the DHT for the specified key.""" + """Get a value from the DHT for the specified key. + + @rtype: C{Deferred} + @return: a deferred that will fire with the stored values + """ def storeValue(self, key, value): """Store a value in the DHT for the specified key."""