#include <mongocxx/v1/pool.hpp>
A thread-safe pool of client objects.
- Important
- This interface does NOT fully conform to the CMAP specification!
- See also
-
- Attention
- This feature is experimental! It is not ready for use!
◆ errc
Errors codes which may be returned by mongocxx::v1::pool.
- Attention
- This feature is experimental! It is not ready for use!
| Enumerator |
|---|
| zero | Zero.
|
| wait_queue_timeout | Failed to acquire a client object due to "waitQueueTimeoutMS".
|
◆ ~pool()
| mongocxx::v1::pool::~pool |
( |
| ) |
|
Destroy this object.
- Warning
- Invalidates all entries and clients associated with this pool.
◆ pool() [1/5]
| mongocxx::v1::pool::pool |
( |
pool && | other | ) |
|
|
noexcept |
Move constructor.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ pool() [2/5]
| mongocxx::v1::pool::pool |
( |
pool const & | other | ) |
|
|
delete |
This class is not copyable.
◆ pool() [3/5]
Initialize this pool with the given URI.
- Note
- No connection is attempted until a client object is acquired from this pool.
- Exceptions
-
◆ pool() [4/5]
| mongocxx::v1::pool::pool |
( |
v1::uri const & | uri | ) |
|
Initialize this pool with the given URI.
- Note
- No connection is attempted until a client object is acquired from this pool.
- Exceptions
-
◆ pool() [5/5]
| mongocxx::v1::pool::pool |
( |
| ) |
|
|
explicit |
Initialize this pool with default URI options.
- Important
- No connection to the MongoDB server(s) is attempted until the first client object is acquired.
- Exceptions
-
◆ acquire()
| entry mongocxx::v1::pool::acquire |
( |
| ) |
|
Return a client object associated with this pool.
This function blocks the current thread until a client object is available or "waitQueueTimeoutMS" is triggered.
- Note
- Connection to the MongoDB server(s) is attempted in a background "monitoring" thread when the first client object is acquired. Server-side errors will only be encountered during or after the first command is executed.
- Returns
- A handle to a client object connected to the MongoDB server(s).
- Exceptions
-
◆ error_category()
| std::error_category const & mongocxx::v1::pool::error_category |
( |
| ) |
|
|
static |
◆ operator bool()
| mongocxx::v1::pool::operator bool |
( |
| ) |
const |
|
explicit |
Return true when *this is NOT in an assign-or-destroy-only state.
◆ operator=() [1/2]
| pool & mongocxx::v1::pool::operator= |
( |
pool && | other | ) |
|
|
noexcept |
Move assignment.
- Postconditions:
- other is in an assign-or-destroy-only state.
◆ operator=() [2/2]
| pool & mongocxx::v1::pool::operator= |
( |
pool const & | other | ) |
|
|
delete |
This class is not copyable.
◆ try_acquire()
Return a client object associated with this pool.
- Note
- The first client object acquired from a pool blocks the current thread until the initial connection to the MongoDB server(s) is established.
-
Connection to the MongoDB server(s) is attempted in a background "monitoring" thread when the first client object is acquired. Server-side errors will only be encountered during or after the first command is executed.
- Returns
- Empty when a client object is not immediately available.
◆ make_error_code
| std::error_code make_error_code |
( |
errc | v | ) |
|
|
friend |
Support implicit conversion to std::error_code.
- Attention
- This feature is experimental! It is not ready for use!
The documentation for this class was generated from the following file: