pvardanis commented on issue #34607:
URL: https://github.com/apache/arrow/issues/34607#issuecomment-1966826035

   @pitrou Following your suggestion I modified my code as follows:
   ```
   async def run_concurrent(client, num_requests):
       loop = asyncio.get_running_loop()
       # 2. Run in a custom thread pool:
       tasks = []
       start = time.time()
       for _ in range(num_requests):
           func = partial(send_concurrent_request, client, table, descriptor)
           with concurrent.futures.ThreadPoolExecutor() as pool:
               tasks.append(loop.run_in_executor(pool, func))
   
       await asyncio.gather(*tasks)
       elapsed = time.time() - start
       print(f"Elapsed: {elapsed}")
   
   if __name__ == "__main__":
       client = flight.FlightClient("grpc://localhost:8080")
       asyncio.run(run_concurrent(client, num_requests=2))
   ```
   
   Testing for 2 requests concurrently still gives me the same as sequential. 
Sorry if I'm missing something again, happy to revisit.


-- 
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]

Reply via email to