![]() |
MySQL 9.5.0
Source Code Documentation
|
pooled connection. More...
#include <connection_pool.h>
Public Types | |
| using | Ssl = mysql_harness::Ssl |
| using | connection_type = T |
Public Member Functions | |
| PooledConnection (connection_type conn) | |
| connection_type & | connection () |
| access to conn_. More... | |
| const connection_type & | connection () const |
| connection_type | release () |
| void | reset () |
| prepares for reusing the connection. More... | |
| void | pool_remover (std::function< void(std::shared_ptr< PooledConnection< T > >)> remover) |
| set a remove-callback. More... | |
Static Public Member Functions | |
| static void | remove_from_pool (std::shared_ptr< PooledConnection< T > > shared_this) |
| calls remove-callback. More... | |
Protected Member Functions | |
| std::mutex & | mtx () |
Protected Attributes | |
| std::function< void(std::shared_ptr< PooledConnection< T > >)> | pool_remover_ |
Static Private Member Functions | |
| static void | async_idle (std::shared_ptr< PooledConnection< T > > shared_this, std::chrono::milliseconds idle_timeout) |
| wait for idle timeout. More... | |
| static void | async_recv_message (std::shared_ptr< PooledConnection< T > > shared_this) |
| wait for server message and shutdown. More... | |
Private Attributes | |
| std::mutex | mtx_ |
| connection_type | conn_ |
| net::steady_timer | idle_timer_ |
Friends | |
| class | ConnectionPool |
pooled connection.
| using PooledConnection< T >::connection_type = T |
| using PooledConnection< T >::Ssl = mysql_harness::Ssl |
|
inline |
|
inlinestaticprivate |
wait for idle timeout.
|
inlinestaticprivate |
wait for server message and shutdown.
|
inline |
access to conn_.
allows others to move the connection structs out.
|
inline |
|
inlineprotected |
|
inline |
set a remove-callback.
used when the pooled connection wants to remove itself from the connection-pool.
|
inline |
|
inlinestatic |
calls remove-callback.
|
inline |
prepares for reusing the connection.
|
friend |
|
private |
|
private |
|
private |
|
protected |