...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Runs the pool task in charge of managing connections.
template< class CompletionToken> auto async_run( CompletionToken&& token);
This function creates and connects new connections, and resets and pings
already created ones. You need to call this function for async_get_connection
to succeed.
The async operation will run indefinitely, until the pool is cancelled
(by being destroyed or calling cancel
). The operation completes
once all internal connection operations (including connects, pings and
resets) complete.
It is safe to call this function after calling cancel
.
This function can be called at most once for a single pool. Formally,
async_run
hasn't been called
before on *this
or any object used to move-construct or move-assign *this
.
Additionally, this->valid() == true
.
While the operation is outstanding, the pool's internal data will be kept
alive. It is safe to destroy *this
while the operation is outstanding.
The handler signature for this operation is void(boost::mysql::error_code)
This function always complete successfully. The handler signature ensures maximum compatibility with Boost.Asio infrastructure.
This function will run entirely in the pool's executor (as given by this->get_executor()
).
No internal data will be accessed or modified as part of the initiating
function. This simplifies thread-safety.
When the pool is constructed with adequate executor configuration, this
function is safe to be called concurrently with async_get_connection
, cancel
, ~pooled_connection
and pooled_connection::return_without_reset
.