forked from LBRYCommunity/lbry-sdk
add removePeer to interface
This commit is contained in:
parent
de1dc507ac
commit
23ce278f8a
|
@ -44,3 +44,9 @@ class DictDataStore(UserDict.DictMixin):
|
||||||
def getPeersForBlob(self, key):
|
def getPeersForBlob(self, key):
|
||||||
if key in self._dict:
|
if key in self._dict:
|
||||||
return [val[0] for val in self._dict[key]]
|
return [val[0] for val in self._dict[key]]
|
||||||
|
|
||||||
|
def removePeer(self, value):
|
||||||
|
for key in self._dict:
|
||||||
|
self._dict[key] = [val for val in self._dict[key] if val[0] != value]
|
||||||
|
if not self._dict[key]:
|
||||||
|
del self._dict[key]
|
||||||
|
|
|
@ -24,6 +24,9 @@ class IDataStore(Interface):
|
||||||
def getPeersForBlob(self, key):
|
def getPeersForBlob(self, key):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
def removePeer(self, key):
|
||||||
|
pass
|
||||||
|
|
||||||
|
|
||||||
class IRoutingTable(Interface):
|
class IRoutingTable(Interface):
|
||||||
""" Interface for RPC message translators/formatters
|
""" Interface for RPC message translators/formatters
|
||||||
|
|
Loading…
Reference in a new issue