Exemplo n.º 1
0
async def request_slow_stream(client: RSocketClient):
    payload = Payload(
        b'The quick brown fox',
        composite(route('slow_stream'), authenticate_simple('user', '12345')))
    completion_event = Event()
    client.request_stream(payload).subscribe(
        StreamSubscriber(completion_event))
    await completion_event.wait()
Exemplo n.º 2
0
async def request_stream_invalid_login(client: RSocketClient):
    payload = Payload(
        b'The quick brown fox',
        composite(route('stream'), authenticate_simple('user',
                                                       'wrong_password')))
    completion_event = Event()
    client.request_stream(payload).initial_request_n(1).subscribe(
        StreamSubscriber(completion_event))
    await completion_event.wait()