コード例 #1
0
async def main():
    from trio.testing import memory_stream_pair
    server_raw_stream, client_raw_stream = memory_stream_pair()

    async with trio.open_nursery() as nursery:
        nursery.start_soon(demo_server, server_raw_stream)
        nursery.start_soon(demo_client, client_raw_stream)
コード例 #2
0
 async def connect(self):
     assert not self.closed
     client, server = memory_stream_pair()
     await self.queued_streams.put(server)
     return client
コード例 #3
0
 async def connect(self):
     assert not self.closed
     client, server = memory_stream_pair()
     await self.queued_streams[0].send(server)
     return client