Make handle_message() public

This commit is contained in:
Kristóf Tóth 2018-12-16 19:16:01 +01:00
parent 09abb0331d
commit a389273779
2 changed files with 3 additions and 3 deletions

View File

@ -4,7 +4,7 @@ from pipe_io_server import PipeIOServer
class EchoPipeIOServer(PipeIOServer):
def _handle_message(self, message):
def handle_message(self, message):
self.send(message)

View File

@ -39,14 +39,14 @@ class PipeIOServer(ABC):
def _init_io_threads(self):
io_threads_dict = {
'reader': PipeReaderThread(self.in_pipe, self._handle_message),
'reader': PipeReaderThread(self.in_pipe, self.handle_message),
'writer': PipeWriterThread(self.out_pipe)
}
IOThreadsTuple = namedtuple('IOThreadsTuple', sorted(io_threads_dict.keys()))
self._io_threads = IOThreadsTuple(**io_threads_dict)
@abstractmethod
def _handle_message(self, message):
def handle_message(self, message):
raise NotImplementedError()
def send(self, message):