def on_connection(pipe: tp.Pipe) -> None: global server_pipe payload = tp.OutgoingPayload(b"Hello ", b"a greeting") tensor = tp.OutgoingTensor(b"World!", b"a place") message = tp.OutgoingMessage(b"metadata", [payload], [tensor]) pipe.write(message, on_write) server_pipe = pipe
def on_connection(pipe: tp.Pipe) -> None: global server_pipe tensor = tp.OutgoingTensor(b"World!", b"") message = tp.OutgoingMessage(b"Hello ", b"", [tensor]) pipe.write(message, on_write) server_pipe = pipe