Esempio n. 1
0
            def stop(self, *a, **kw):
                d = ComponentWrapper.stop(self, *a, **kw)

                def delay_stop(result):
                    # breaking once should be enough
                    if self.do_break:
                        self.do_break = False
                        raise CustomStopException()
                d.addCallback(delay_stop)
                return d
Esempio n. 2
0
    def testSuccess(self):
        pp = ComponentWrapper('pipeline-producer', Producer,
                              name='pp', props={'pipeline':
                                                'audiotestsrc is-live=1'},
                              cfg={'clock-master': '/default/pp'})

        d = pp.instantiate()
        d.addCallback(lambda _: pp.wait_for_mood(moods.happy))
        d.addCallback(lambda _: pp.stop())
        return d
Esempio n. 3
0
            def stop(self, *a, **kw):
                d = ComponentWrapper.stop(self, *a, **kw)

                def delay_stop(result):
                    if self.do_delay:
                        self.do_delay = False
                        dd = defer.Deferred()
                        reactor.callLater(stop_delay_time, dd.callback, result)
                        return dd
                    return result
                d.addCallback(delay_stop)
                return d
Esempio n. 4
0
    def testSuccess(self):
        pp = ComponentWrapper(
            "pipeline-producer",
            Producer,
            name="pp",
            props={"pipeline": "audiotestsrc is-live=1"},
            cfg={"clock-master": "/default/pp"},
        )

        d = pp.instantiate()
        d.addCallback(lambda _: pp.wait_for_mood(moods.happy))
        d.addCallback(lambda _: pp.stop())
        return d