Difference between execute_async () and execute_concurrent ()

I want to know the difference between execute_async()

and execute_concurrent()

in python for Cassandra requests.

+3


source to share


1 answer


execute()

will run one statement as a blocking call that will not return until the statement completes.

execute_async()

will dispatch one statement as an asynchronous call that will return immediately with an object response_future

that you can use to get the results later. By calling execute_async

, your program can continue without waiting for the instruction to complete. Since it does not block, you can submit multiple applications by calling it again and have them "in flight" at the same time.



execute_concurrent()

is a blocking call that will run the statement list in parallel and return the result list. As a thread pool, you can specify how many statements you want to allow them to run at a time. And you can set the flag if you want it to return immediately if any of the statements result in an error.

+4


source







All Articles