Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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)
Beispiel #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())))
Beispiel #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")
Beispiel #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")
Beispiel #8
0
 def ready(self, *args):
     self.fire(ipc(ping(time())))
Beispiel #9
0
 def ping(self, ts):
     self.fire(ipc(pong(ts, time())))
Beispiel #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())))
Beispiel #11
0
 def ready(self, *args):
     self.fire(ipc(ping(time())))
Beispiel #12
0
 def ping(self, ts):
     self.fire(ipc(pong(ts, time())))