pvardanis commented on issue #34607:
URL: https://github.com/apache/arrow/issues/34607#issuecomment-1966712089
@lidavidm I've also tried with `asyncio`:
```python
async def send_concurrent_request(client, table, descriptor):
try:
writer, reader = client.do_exchange(descriptor)
writer.begin(table.schema)
for batch in table.to_batches():
writer.write_batch(batch)
writer.done_writing()
result = reader.read_chunk().data.to_pydict()
return result
except StopIteration as e:
# print(f"Error: {e}")
return None
async def gather_concurrent_requests(clients, table, descriptor):
tasks = []
for client in clients:
tasks.append(send_concurrent_request(client, table, descriptor))
return await asyncio.gather(*tasks, return_exceptions=True)
async def run_concurrent(clients):
start = time.time()
results = await gather_concurrent_requests(clients, table, descriptor)
elapsed = time.time() - start
print(f"Elapsed: {elapsed}")
print(results)
clients = [flight.FlightClient("grpc://localhost:8080") for _ in range(2)]
asyncio.run(run_concurrent(clients))
```
and I get the same performance.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]