Esempio n. 1
0
                  oqueues=(v2_queue.raw,),
                  infoqueue=info_queue)
    mixer.start()

    if stream:
        import brain
        Hotswap(track_queue.put, brain).start()
    Hotswap(InfoHandler.add, info, 'generate', info_queue, first_frame).start()
    Hotswap(MonitorSocket.update,
            statistician, 'generate',
            get_listeners,
            mp3_queue=v2_queue).start()

    tornado.ioloop.PeriodicCallback(
        lambda: restart.check('restart.txt',
                              started_at_timestamp,
                              sum([len(x.listeners) for x in StreamHandler._StreamHandler__subclasses])),
        config.restart_timeout * 1000
    ).start()
    tornado.ioloop.PeriodicCallback(InfoHandler.clean, 5 * 1000).start()

    stream_routes = StreamHandler.init_streams([
        (r"/all.mp3", "All", v2_queue)
    ])

    application = tornado.web.Application(
        tornadio2.TornadioRouter(SocketConnection).apply_routes([
            # Static assets for local development
            (r"/(favicon.ico)", tornado.web.StaticFileHandler, {"path": "static/img/"}),
            (r"/static/(.*)", tornado.web.StaticFileHandler, {"path": "static/"}),
            (r"/all.json", InfoHandler),
Esempio n. 2
0
                  infoqueue=info_queue)
    mixer.start()

    if stream:
        import brain
        Hotswap(track_queue.put, brain).start()
    Hotswap(InfoHandler.add, info, 'generate', info_queue, first_frame).start()
    Hotswap(MonitorSocket.update,
            statistician,
            'generate',
            lambda: StreamHandler.relays,
            InfoHandler.stats,
            mp3_queue=v2_queue).start()

    tornado.ioloop.PeriodicCallback(
        lambda: restart.check('restart.txt', started_at_timestamp,
                              len(StreamHandler.relays)),
        config.restart_timeout * 1000).start()
    tornado.ioloop.PeriodicCallback(InfoHandler.clean, 5 * 1000).start()
    tornado.ioloop.PeriodicCallback(StreamHandler.check, 10 * 1000).start()

    StreamHandler.relays = Listeners(v2_queue, "All", first_frame)

    application = tornado.web.Application(
        tornadio2.TornadioRouter(SocketConnection).apply_routes([
            # Static assets for local development
            (r"/(favicon.ico)", tornado.web.StaticFileHandler, {
                "path": "static/img/"
            }),
            (r"/static/(.*)", tornado.web.StaticFileHandler, {
                "path": "static/"
            }),
Esempio n. 3
0
                  infoqueue=info_queue)
    mixer.start()

    if stream:
        import brain
        Hotswap(track_queue.put, brain).start()
    Hotswap(InfoHandler.add, info, 'generate', info_queue, first_frame).start()
    Hotswap(MonitorSocket.update,
            statistician, 'generate',
            lambda: StreamHandler.relays,
            InfoHandler.stats,
            mp3_queue=v2_queue).start()

    tornado.ioloop.PeriodicCallback(
        lambda: restart.check('restart.txt',
                              started_at_timestamp,
                              len(StreamHandler.relays)),
        config.restart_timeout * 1000
    ).start()
    tornado.ioloop.PeriodicCallback(InfoHandler.clean, 5 * 1000).start()
    tornado.ioloop.PeriodicCallback(StreamHandler.check, 10 * 1000).start()

    StreamHandler.relays = Listeners(v2_queue, "All", first_frame)

    application = tornado.web.Application(
        tornadio2.TornadioRouter(SocketConnection).apply_routes([
            # Static assets for local development
            (r"/(favicon.ico)", tornado.web.StaticFileHandler, {"path": "static/img/"}),
            (r"/static/(.*)", tornado.web.StaticFileHandler, {"path": "static/"}),

            (r"/timing.json", TimingHandler),
Esempio n. 4
0
    mixer.start()

    if stream:
        import brain
        Hotswap(track_queue.put, brain).start()
    Hotswap(InfoHandler.add, info, 'generate', info_queue, first_frame).start()
    Hotswap(MonitorSocket.update,
            statistician,
            'generate',
            get_listeners,
            mp3_queue=v2_queue).start()

    tornado.ioloop.PeriodicCallback(
        lambda: restart.check(
            'restart.txt', started_at_timestamp,
            sum([
                len(x.listeners)
                for x in StreamHandler._StreamHandler__subclasses
            ])), config.restart_timeout * 1000).start()
    tornado.ioloop.PeriodicCallback(InfoHandler.clean, 5 * 1000).start()

    stream_routes = StreamHandler.init_streams([(r"/all.mp3", "All", v2_queue)
                                                ])

    application = tornado.web.Application(
        tornadio2.TornadioRouter(SocketConnection).apply_routes([
            # Static assets for local development
            (r"/(favicon.ico)", tornado.web.StaticFileHandler, {
                "path": "static/img/"
            }),
            (r"/static/(.*)", tornado.web.StaticFileHandler, {
                "path": "static/"