def stream_skypipe_output(endpoint, name=None):
name = name or '<STR_LIT>'<EOL>socket = ctx.socket(zmq.DEALER)<EOL>socket.connect(endpoint)<EOL>try:<EOL><INDENT>socket.send_multipart(sp_msg(SP_CMD_LISTEN, name))<EOL>while True:<EOL><INDENT>msg = socket.recv_multipart()<EOL>try:<EOL><INDENT>data = parse_skypipe_data_stream(msg, name)<EOL>if data:<EOL><INDENT>yield data<EOL><DEDENT><DEDENT>except EOFError:<EOL><INDENT>raise StopIteration()<EOL><DEDENT><DEDENT><DEDENT>finally:<EOL><INDENT>socket.send_multipart(sp_msg(SP_CMD_UNLISTEN, name))<EOL>socket.close()<EOL><DEDENT>
Generator for reading skypipe data