Make notifee functions all async

This commit is contained in:
Stuckinaboot
2019-02-28 19:11:04 -05:00
parent 3beec9d4ae
commit 1ecdcf7df4
3 changed files with 17 additions and 16 deletions

View File

@ -76,7 +76,7 @@ class Swarm(INetwork):
# Call notifiers since event occurred
for notifee in self.notifees:
notifee.connected(self, muxed_conn)
await notifee.connected(self, muxed_conn)
return muxed_conn
@ -110,7 +110,7 @@ class Swarm(INetwork):
# Call notifiers since event occurred
for notifee in self.notifees:
notifee.opened_stream(self, net_stream)
await notifee.opened_stream(self, net_stream)
return net_stream
@ -151,7 +151,7 @@ class Swarm(INetwork):
# Call notifiers since event occurred
for notifee in self.notifees:
notifee.connected(self, muxed_conn)
await notifee.connected(self, muxed_conn)
try:
# Success
@ -161,7 +161,7 @@ class Swarm(INetwork):
# Call notifiers since event occurred
for notifee in self.notifees:
notifee.listen(self, multiaddr)
await notifee.listen(self, multiaddr)
return True
except IOError: