예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #5
0
파일: pingpong.py 프로젝트: ke4roh/circuits
 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())))
예제 #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")
예제 #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")
예제 #8
0
파일: pingpong.py 프로젝트: sumect/circuits
 def ready(self, *args):
     self.fire(ipc(ping(time())))
예제 #9
0
파일: pingpong.py 프로젝트: sumect/circuits
 def ping(self, ts):
     self.fire(ipc(pong(ts, time())))
예제 #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())))
예제 #11
0
 def ready(self, *args):
     self.fire(ipc(ping(time())))
예제 #12
0
 def ping(self, ts):
     self.fire(ipc(pong(ts, time())))