olp-cpp-sdk
1.21.0
|
Fills in the OlpClientSettings
structure with default handlers.
More...
#include <OlpClientSettingsFactory.h>
Static Public Member Functions | |
static std::unique_ptr< thread::TaskScheduler > | CreateDefaultTaskScheduler (size_t thread_count=1u) |
Creates the TaskScheduler instance used for all the delayed operations. More... | |
static std::shared_ptr< http::Network > | CreateDefaultNetworkRequestHandler (size_t max_requests_count=30u) |
Creates the Network instance used for all the non-local requests. More... | |
static std::shared_ptr< http::Network > | CreateDefaultNetworkRequestHandler (http::NetworkInitializationSettings settings) |
Creates the Network instance used for all the non-local requests. More... | |
static std::unique_ptr< cache::KeyValueCache > | CreateDefaultCache (cache::CacheSettings settings) |
Creates the KeyValueCache instance that includes both a small memory LRU cache and a larger persistent database cache. More... | |
static void | PrewarmConnection (const OlpClientSettings &settings, const std::string &url, http::Network::Callback callback=nullptr) |
This function helps you prewarm the connection to the provided host. More... | |
Fills in the OlpClientSettings
structure with default handlers.
|
static |
Creates the KeyValueCache
instance that includes both a small memory LRU cache and a larger persistent database cache.
The returned cache instance is initialized, opened, and ready to be used.
CacheSettings
instance includes a valid disk path with the corresponding write permissions set.[in] | settings | The CacheSettings instance. |
KeyValueCache
instance.
|
static |
Creates the Network
instance used for all the non-local requests.
Defaulted to platform-specific implementation.
On UNIX platforms, the default network request handler is libcurl-based and has the known issue of static initialization and cleanup that needs special care. Therefore, we recommend initializing this network request handler at a very early stage, preferably as global static or from the main thread, and pass it on to every created client. For this matter, it is also not recommended to create multiple network request handlers.
[in] | settings | The NetworkInitializationSettings instance. |
Network
instance.
|
static |
Creates the Network
instance used for all the non-local requests.
Defaulted to platform-specific implementation.
On UNIX platforms, the default network request handler is libcurl-based and has the known issue of static initialization and cleanup that needs special care. Therefore, we recommend initializing this network request handler at a very early stage, preferably as global static or from the main thread, and pass it on to every created client. For this matter, it is also not recommended to create multiple network request handlers.
Network
instance.
|
static |
Creates the TaskScheduler
instance used for all the delayed operations.
Defaulted to olp::thread::ThreadPoolTaskScheduler
with one worker thread spawned by default.
TaskScheduler
instance.
|
static |
This function helps you prewarm the connection to the provided host.
Prewarming includes DNS prefetch and TLS preconnect issued with the OPTIONS http call without any data up or download and is performed asynchronously.
[in] | settings | The OlpClientSettings instance. |
[in] | url | The url of the host. |
[in] | callback | The user callback will be called when request completed. |