def main(): http_console_server.start(port=ARCHIVER_PORT) sys.stderr.write(">>> starting pipeline\n") try: run_pipeline() finally: http_console_server.stop() sys.stderr.write(">>> shutdown complete\n")
def tearDown(self): # Stop the server. try: http_console_server.stop() except: # Showing the test failure is more important than this. import traceback traceback.print_exc()
def main(): http_console_server.start() hp = http_puller.HttpPuller(STREAM_HOST, STREAM_PORT, STREAM_PATH) hp_tee = message.MessageTee(hp, 2) hp_proxy, hp_fs = hp_tee.outputs proxy = http_proxy.HttpProxy(hp_proxy, STREAM_PROXY_HOST, STREAM_PROXY_PORT) fs = frame_splitter.FrameSplitter(hp_fs) fs_tee = message.MessageTee(fs, 2) fs_stats, fs_arch = fs_tee.outputs stats = statistics.Statistics(fs_stats) stats.export() # TODO(trow): Ultimately we'll put the archiver here. arch = logger.Logger(fs_arch) all_objects = (hp, hp_tee, proxy, fs, fs_tee, stats, arch) for obj in all_objects: obj.loop_in_thread() try: while True: time.sleep(1 << 20) # 2^20 seconds = ~12 days except KeyboardInterrupt: pass sys.stderr.write(">>> stopping\n") hp.stop() for obj in all_objects: obj.wait() http_console_server.stop() sys.stderr.write(">>> shutdown complete\n")