Execute asynchronously

The executeAsync() method of a session instance executes a query asynchronously. The method is non-blocking. It passes a query to the underlying network stack and returns immediately. One thing to consider is it doesn't guarantee that the query was passed to a node or that it was valid. Query failures/exceptions are detected when you access the ResultSetFuture.

ResultSetFuture is a future on ResultSet. It includes all the methods of Future <ResultSet>. It adds the following methods for processing the results:

  • ResultSet getUninterruptibly(): This method waits for the query to return and return its result
  • ResultSet getUninterruptibly(long timeout, TimeUnit unit): This is the same as the previous method and includes waiting ...

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.