You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Represents container occupied with opened sockets. Uses [connector](#connector) to open new sockets in the background thread which is triggered once there are vacant places in the pool. User can call *get_session()* to obtain a socket from the pool and *return_session()* to give it back.
121
121
122
122
There are two strategies to refill the pool:
123
-
- greedy (`stream_client::connector::greedy_strategy`). If there are vacant places it will try to fill them with new sessions simultaneously.
124
-
- conservative (`stream_client::connector::conservative_strategy`). Will try to fill up to 2/3 of vacant places in the poll. If failed will back of for some time and retry later. Also, after failures it will create only one new session.
123
+
- **greedy** (`stream_client::connector::greedy_strategy`). If there are vacant places it will try to fill them with new sessions simultaneously. This is the default one.
124
+
- **conservative** (`stream_client::connector::conservative_strategy`). Will try to fill up to 2/3 of vacant places in the poll. If failed will back of for some time and retry later. Also, after failures it will create only one new session.
125
+
125
126
Both of them are defined in terms of `stream_client::connector::pool_strategy` interface, so you are free to implement new one.
126
127
127
128
Limitations:
@@ -143,7 +144,12 @@ Connection pools:
143
144
* `stream_client::connector::http_pool` - pool of `stream_client::http::http_client` sockets.
144
145
* `stream_client::connector::https_pool` - pool of `stream_client::http::https_client` sockets.
145
146
146
-
*All these pools are using `stream_client::connector::greedy_strategy`.*
147
+
There are also aliases for the same pools but using conservative reconnection strategy:
The library uses basic logger interface implemented internally. You can modify logger level using `stream_client::set_log_level()` or `stream_client::get_log_level()` functions.
193
+
194
+
These levels are supported:
195
+
```cpp
196
+
enumclasslog_level : int
197
+
{
198
+
trace = 0,
199
+
debug,
200
+
info,
201
+
warning,
202
+
error,
203
+
};
204
+
```
205
+
206
+
By default library prints messages to stdout with decent formatting. If you want to overwrite this behavior you can set you own logger via:
0 commit comments