Add return value to Notify

This commit is contained in:
Stuckinaboot 2019-03-14 14:01:37 -04:00
parent d800b3ef41
commit 7d45131f37
2 changed files with 4 additions and 0 deletions

View File

@ -46,4 +46,5 @@ class INetwork(ABC):
def notify(self, notifee):
"""
:param notifee: object implementing Notifee interface
:return: true if notifee registered successfully, false otherwise
"""

View File

@ -175,9 +175,12 @@ class Swarm(INetwork):
def notify(self, notifee):
"""
:param notifee: object implementing Notifee interface
:return: true if notifee registered successfully, false otherwise
"""
if isinstance(notifee, INotifee):
self.notifees.append(notifee)
return True
return False
def add_transport(self, transport):
# TODO: Support more than one transport