def consume(): # Start a tornado IOLoop for reading/writing to the process in this thread ioloop.IOLoop() reader = streams.JsonRpcStreamReader(proc.stdout) reader.listen(lambda msg: self.write_message(json.dumps(msg)))
def consume(): reader = streams.JsonRpcStreamReader(pyls_process.stdout) reader.listen(lambda msg: ws.send(json.dumps(msg)))
def start(self, rx, tx): """Entry point for the server.""" self._jsonrpc_stream_reader = streams.JsonRpcStreamReader(rx) self._jsonrpc_stream_writer = streams.JsonRpcStreamWriter(tx) self.set_endpoint(self._jsonrpc_stream_writer.write) self._jsonrpc_stream_reader.listen(self.endpoint.consume)
def consume(): ioloop.IOLoop() reader = streams.JsonRpcStreamReader(proc.stdout) reader.listen(lambda msg: self.write_message(json.dumps(msg)))
def __init__(self, ifile, ofile): super(StdIOServer, self).__init__() self._istream = streams.JsonRpcStreamReader(ifile) self._ostream = streams.JsonRpcStreamWriter(ofile) self.endpoint = endpoint.Endpoint(self, self._ostream.write)