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)
def ready(self, *args): x = yield self.call(hello()) yield print(x) y = yield self.call(ipc(hello())) yield print(y) raise SystemExit(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())))
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")
def ready(self, *args): self.fire(ipc(ping(time())))
def ping(self, ts): self.fire(ipc(pong(ts, time())))
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())))