py-libp2p/muxer/muxed_stream_interface.py

26 lines
497 B
Python
Raw Normal View History

2018-11-01 05:31:00 +08:00
from abc import ABC, abstractmethod
2018-11-01 06:02:00 +08:00
# from datetime import time
2018-11-01 05:31:00 +08:00
class IMuxedStream(ABC):
# TODO Reader
# TODO Writer
# TODO Closer
@abstractmethod
def reset(self):
"""
closes both ends of the stream
tells this remote side to hang up
:return: error/exception
"""
pass
@abstractmethod
def set_deadline(self, ttl):
"""
set deadline for muxed stream
:return: a new stream
"""
pass