Cassandra Python driver supports asynchronous queries via execute_async() method. This method immediately return ResponseFuture object. There are two ways to get final results from the object
- result(): The first is by calling the result() function. This would block untill query is completed or it would raise an exception in case of error.
- callbacks: Alternatively, you can attach callbacks and errback funtion through add_callback(), add_errback() and add_callbacks() function.
Complete example:
References:
https://datastax.github.io/python-driver/getting_started.html
No comments:
Post a Comment