Esempio n. 1
0
    def go(self):
        x = yield self.call(hello())
        yield print(x)

        y = yield self.call(ipc(hello()), self.child1[1].channel)
        yield print(y)

        z = yield self.call(ipc(hello()), self.child2[1].channel)
        yield print(z)

        raise SystemExit(0)
Esempio n. 2
0
    def go(self):
        x = yield self.call(hello())
        yield print(x)

        y = yield self.call(ipc(hello()), self.child1[1].channel)
        yield print(y)

        z = yield self.call(ipc(hello()), self.child2[1].channel)
        yield print(z)

        raise SystemExit(0)
Esempio n. 3
0
    def ready(self, *args):
        x = yield self.call(hello())
        yield print(x)

        y = yield self.call(ipc(hello()))
        yield print(y)

        raise SystemExit(0)
Esempio n. 4
0
    def ready(self, *args):
        x = yield self.call(hello())
        yield print(x)

        y = yield self.call(ipc(hello()))
        yield print(y)

        raise SystemExit(0)
Esempio n. 5
0
 def pong(self, ts1, ts2):
     latency = (ts2 - ts1) * 1000.0
     status(
         "{0:d} event/s @ {1:0.2f}ms latency".format(
             int(self.events / (time() - self.stime)),
             latency
         )
     )
     self.fire(ipc(ping(time())))
Esempio n. 6
0
def test(manager, watcher):
    app = App()
    process, bridge = app.start(process=True, link=manager)
    assert watcher.wait("ready")

    x = manager.fire(ipc(hello()))

    assert pytest.wait_for(x, "result")

    assert x.value == "Hello from {0:d}".format(app.pid)

    app.stop()
    app.join()

    bridge.unregister()
    watcher.wait("unregistered")
Esempio n. 7
0
def test(manager, watcher):
    app = App()
    process, bridge = app.start(process=True, link=manager)
    assert watcher.wait("ready")

    x = manager.fire(ipc(hello()))

    assert pytest.wait_for(x, "result")

    assert x.value == "Hello from {0:d}".format(app.pid)

    app.stop()
    app.join()

    bridge.unregister()
    watcher.wait("unregistered")
Esempio n. 8
0
 def ready(self, *args):
     self.fire(ipc(ping(time())))
Esempio n. 9
0
 def ping(self, ts):
     self.fire(ipc(pong(ts, time())))
Esempio n. 10
0
 def pong(self, ts1, ts2):
     latency = (ts2 - ts1) * 1000.0
     status("{0:d} event/s @ {1:0.2f}ms latency".format(
         int(self.events / (time() - self.stime)), latency))
     self.fire(ipc(ping(time())))
Esempio n. 11
0
 def ready(self, *args):
     self.fire(ipc(ping(time())))
Esempio n. 12
0
 def ping(self, ts):
     self.fire(ipc(pong(ts, time())))