def execute_concurrent(session, statements_and_parameters, concurrency=100, raise_on_first_error=True, results_generator=False):
 if (concurrency <= 0):
  raise ValueError('concurrency must be greater than 0')
 if (not statements_and_parameters):
  return []
 executor = (ConcurrentExecutorGenResults(session, statements_and_parameters) if results_generator else ConcurrentExecutorListResults(session, statements_and_parameters))
 return executor.execute(concurrency, raise_on_first_error)

def execute_concurrent ( session , statements_and_parameters , concurrency = 100 , raise_on_first_error = True , results_generator = False ) : if ( concurrency <= 0 ) : raise ValueError ( 'concurrency must be greater than 0' ) if ( not statements_and_parameters ) : return [ ] executor = ( ConcurrentExecutorGenResults ( session , statements_and_parameters ) if results_generator else ConcurrentExecutorListResults ( session , statements_and_parameters ) ) return executor . execute ( concurrency , raise_on_first_error )
executes a sequence of tuples concurrently .