Table of Contents
- 7.1 Overview of the C API Asynchronous Interface
- 7.2 C API Asynchronous Interface Data Structures
- 7.3 C API Asynchronous Function Reference
- 7.4 C API Asynchronous Function Descriptions
- 7.4.1 mysql_fetch_row_nonblocking()
- 7.4.2 mysql_free_result_nonblocking()
- 7.4.3 mysql_get_connect_nonblocking_stage()
- 7.4.4 mysql_next_result_nonblocking()
- 7.4.5 mysql_real_connect_nonblocking()
- 7.4.6 mysql_real_query_nonblocking()
- 7.4.7 mysql_reset_connection_nonblocking()
- 7.4.8 mysql_store_result_nonblocking()
As of MySQL 8.0.16, the C API includes asynchronous functions that enable nonblocking communication with the MySQL server. Asynchronous functions enable development of applications that differ from the query processing model based on synchronous functions that block if reads from or writes to the server connection must wait. Using the asynchronous functions, an application can check whether work on the server connection is ready to proceed. If not, the application can perform other work before checking again later.
For example, an application might open multiple connections to the server and use them to submit multiple statements for execution. The application then can poll the connections to see which of them have results to be fetched, while doing other work.
As just indicated, execution of multiple simultaneous statements should be done using multiple connections and executing one statement per connection. The asynchronous interface is not intended for executing multiple simultaneous statements per connection. What it enables is that applications can do other work rather than waiting for server operations to complete.