def receiver_proc2(coro=None):
    # if server is in remote network, add it explicitly
    # yield scheduler.peer('remote.peer.ip', stream_send=True)
    # get reference to remote channel in server
    rchannel = yield asyncoro.Channel.locate('2clients')
    # this coro subscribes to the channel, so gets messages to server
    # channel
    print('server is at %s' % rchannel.location)
    if (yield rchannel.subscribe(coro)) != 0:
        raise Exception('subscription failed')
    asyncoro.Coro(sender_proc, rchannel)
    while True:
        msg = yield coro.receive()
        if msg is None:
            break
        print('Received "%s" from %s at %s' % \
              (msg['msg'], msg['sender'].name, msg['sender'].location))
    yield rchannel.unsubscribe(coro)
dataset/ETHPy150Open pgiri/asyncoro/examples/remote_channel_client.py/receiver_proc2/original