Ejemplo n.º 1
0
 def __init__(self, *args):
     self.decoder = OutputDecoder()
     # TODO remove port from code
     self.main_loop = None
     self.buffer = {"buffer": {}}
     self.application_handlers = [(r"/console2", WebSocketHandler, {
         "configs": self.buffer
     })]
Ejemplo n.º 2
0
    def __init__(self, *args):
        self.logger = None
        # deprecated
        self.decoder = OutputDecoder()
        # TODO remove port from code
        self.main_loop = tornado.ioloop.IOLoop.instance()
        self.pool = {"buffer": {}, "task": None}

        self.application_handlers = [(r"/socket/log", WebSocketHandler, {
            "configs": self.pool
        }), (r"/test", MainHandler, {
            "configs": self.pool
        })]
Ejemplo n.º 3
0
 def __init__(self, stream):
     """
     Creates thread which wait data from stream and put they in inter-thread queue
     :param stream: stream to read
     """
     # input stream to read
     self.stream = stream
     # inter-thread queue to pass data from stream
     self.queue = Queue()
     # stream-read thread
     self.thread = Thread(target=self.wait_output)
     self.thread.daemon = True
     self.thread.start()
     self.decoder = OutputDecoder()