muxed stream

This commit is contained in:
zixuanzh
2018-11-11 18:03:04 -05:00
parent 55dae3ed1e
commit fe20d25882
5 changed files with 122 additions and 18 deletions

View File

@ -1,11 +1,31 @@
from abc import ABC, abstractmethod
# from datetime import time
class IMuxedStream(ABC):
# TODO Reader
# TODO Writer
# TODO Closer
@abstractmethod
def read(self):
"""
read from stream
:return: bytes of input
"""
pass
@abstractmethod
def write(self, _bytes):
"""
write to stream
:return: number of bytes written
"""
pass
@abstractmethod
def close(self):
"""
close stream
:return: true if successful
"""
pass
@abstractmethod
def reset(self):