mirror of
https://github.com/varun-r-mallya/py-libp2p.git
synced 2025-12-31 20:36:24 +00:00
Add "default protocols" that all hosts have by default
This commit is contained in:
@ -19,8 +19,8 @@ class Multiselect(IMultiselectMuxer):
|
||||
|
||||
handlers: Dict[TProtocol, StreamHandlerFn]
|
||||
|
||||
def __init__(self) -> None:
|
||||
self.handlers = {}
|
||||
def __init__(self, default_handlers: Dict[TProtocol, StreamHandlerFn] = {}) -> None:
|
||||
self.handlers = default_handlers
|
||||
|
||||
def add_handler(self, protocol: TProtocol, handler: StreamHandlerFn) -> None:
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user