MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / execute_concurrent_async

Function execute_concurrent_async

cassandra/concurrent.py:188–213  ·  view source on GitHub ↗

See :meth:`.Session.execute_concurrent_async`.

(
    session,
    statements_and_parameters,
    concurrency=100,
    raise_on_first_error=False,
    execution_profile=EXEC_PROFILE_DEFAULT
)

Source from the content-addressed store, hash-verified

186
187
188def execute_concurrent_async(
189 session,
190 statements_and_parameters,
191 concurrency=100,
192 raise_on_first_error=False,
193 execution_profile=EXEC_PROFILE_DEFAULT
194):
195 """
196 See :meth:`.Session.execute_concurrent_async`.
197 """
198 # Create a Future object and initialize the custom ConcurrentExecutor with the Future
199 future = Future()
200 executor = ConcurrentExecutorFutureResults(
201 session=session,
202 statements_and_params=statements_and_parameters,
203 execution_profile=execution_profile,
204 future=future
205 )
206
207 # Execute concurrently
208 try:
209 executor.execute(concurrency=concurrency, fail_fast=raise_on_first_error)
210 except Exception as e:
211 future.set_exception(e)
212
213 return future

Callers 2

Calls 2

executeMethod · 0.45

Tested by 1