HttpClient implementation.
More...
HttpClient implementation.
Definition at line 1725 of file client.cc.
isc::http::HttpClientImpl::HttpClientImpl |
( |
IOService & |
io_service, |
|
|
size_t |
thread_pool_size = 0 , |
|
|
bool |
defer_thread_start = false |
|
) |
| |
|
inline |
Constructor.
If single-threading:
- Creates the connection pool passing in the caller's IOService and a maximum number of connections per URL value of 1. If multi-threading:
- Creates a private IOService
- Creates a thread pool with the thread_pool_size threads
- Creates the connection pool passing the private IOService and the thread_pool_size as the maximum number of connections per URL.
- Parameters
-
io_service | IOService that will drive connection IO in single threaded mode. (Currently ignored in multi-threaded mode) |
thread_pool_size | maximum number of concurrent threads Internally this also sets the maximum number of concurrent connections per URL. |
defer_thread_start | When true, starting of the pool threads is deferred until a subsequent call to start(). In this case the pool's operational state after construction is STOPPED. Otherwise, the thread pool threads will be created and started, with the operational state being RUNNING. Applicable only when thread-pool size is greater than zero. |
Definition at line 1750 of file client.cc.
References conn_pool_, isc::log::DBGLVL_TRACE_BASIC, getThreadCount(), isc::http::HTTP_CLIENT_MT_STARTED, isc::http::http_logger, and LOG_DEBUG.
isc::http::HttpClientImpl::~HttpClientImpl |
( |
| ) |
|
|
inline |
uint16_t isc::http::HttpClientImpl::getThreadCount |
( |
| ) |
|
|
inline |
Fetches the number of threads in the pool.
- Returns
- the number of running threads.
Definition at line 1880 of file client.cc.
Referenced by HttpClientImpl().
Fetches the internal IOService used in multi-threaded mode.
- Returns
- A pointer to the IOService, or an empty pointer when in single-threaded mode.
Definition at line 1866 of file client.cc.
uint16_t isc::http::HttpClientImpl::getThreadPoolSize |
( |
| ) |
|
|
inline |
Fetches the maximum size of the thread pool.
- Returns
- the maximum size of the thread pool.
Definition at line 1873 of file client.cc.
bool isc::http::HttpClientImpl::isPaused |
( |
| ) |
|
|
inline |
Indicates if the thread pool is paused.
- Returns
- True if the thread pool exists and it is in the PAUSED state, false otherwise.
Definition at line 1854 of file client.cc.
bool isc::http::HttpClientImpl::isRunning |
( |
| ) |
|
|
inline |
Indicates if the thread pool is running.
- Returns
- True if the thread pool exists and it is in the RUNNING state, false otherwise.
Definition at line 1830 of file client.cc.
bool isc::http::HttpClientImpl::isStopped |
( |
| ) |
|
|
inline |
Indicates if the thread pool is stopped.
- Returns
- True if the thread pool exists and it is in the STOPPED state, false otherwise.
Definition at line 1842 of file client.cc.
void isc::http::HttpClientImpl::pause |
( |
| ) |
|
|
inline |
Pauses the client's thread pool.
Suspends thread pool event processing.
- Exceptions
-
Definition at line 1804 of file client.cc.
References isc_throw.
void isc::http::HttpClientImpl::resume |
( |
| ) |
|
|
inline |
Resumes running the client's thread pool.
Resumes thread pool event processing.
- Exceptions
-
Definition at line 1817 of file client.cc.
References isc_throw.
void isc::http::HttpClientImpl::start |
( |
| ) |
|
|
inline |
Starts running the client's thread pool, if multi-threaded.
Definition at line 1782 of file client.cc.
void isc::http::HttpClientImpl::stop |
( |
| ) |
|
|
inline |
ConnectionPoolPtr isc::http::HttpClientImpl::conn_pool_ |
The documentation for this class was generated from the following file: