コード例 #1
0
ファイル: raw.py プロジェクト: yarpc/yarpc-python
def raw(respw, server, transport, **kwargs):
    rpc = RPC(
        service='client',
        outbounds={
            'yarpc-test': tr.factory(server, transport),
        },
    )

    expected = rand.string(7)

    request = Request(procedure='echo/raw', body=expected, ttl=10000)
    client = RawClient(rpc.channel('yarpc-test'))
    response = yield client.call(request)

    if response.body == expected:
        respw.success("Server said: %s" % response.body)
    else:
        respw.fail("expected %s, got %s" % (expected, response.body))
コード例 #2
0
ファイル: headers.py プロジェクト: yarpc/yarpc-python
class RawCaller(object):

    def __init__(self, channel):
        self._client = RawClient(channel)

    def call(self, headers):
        request = Request(
            procedure='echo/raw',
            ttl=10000,
            headers=headers,
        )
        return self._client.call(request)
コード例 #3
0
ファイル: headers.py プロジェクト: yarpc/yarpc-python
 def __init__(self, channel):
     self._client = RawClient(channel)