...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
Stops any current outstanding operation and marks the pool as cancelled.
void cancel();
This function has the following effects:
async_run
operation, if any,
which will complete with a success error code.
async_get_connection
operations,
which will complete with client_errc::cancelled
.
async_get_connection
calls will complete immediately with client_errc::cancelled
.
This function will return immediately, without waiting for the cancelled operations to complete.
You may call this function any number of times. Successive calls will have no effect.
this->valid() == true
Basic guarantee. Memory allocations and acquiring mutexes may throw.
When the pool is constructed with adequate executor configuration, this
function is safe to be called concurrently with async_run
, async_get_connection
, ~pooled_connection
and pooled_connection::return_without_reset
.