update interfaces

This commit is contained in:
zixuanzh
2018-10-14 14:11:03 -04:00
parent 278a2d3b34
commit a672a5017f
3 changed files with 19 additions and 3 deletions

View File

@ -33,17 +33,19 @@ class Host(ABC):
"""
set stream handler for host
:param protocol_id: protocol id used on stream
:param stream_handler: a stream handler instance
:param stream_handler: a stream handler function
:return: true if successful
"""
pass
# protocol_id can be a list of protocol_ids
# stream will decide which protocol_id to run on
@abstractmethod
def new_stream(self, context, peer_id, protocol_ids):
def new_stream(self, context, peer_id, protocol_id):
"""
:param context: a context instance
:param peer_id: peer_id that host is connecting
:param proto_ids: list of protocol ids that stream runs on
:param proto_id: protocol id that stream runs on
:return: true if successful
"""
pass