Template Class pool_strategy¶
Defined in File pool_strategy.hpp
Inheritance Relationships¶
Derived Types¶
public stream_client::connector::conservative_strategy< Connector >
(Template Class conservative_strategy)public stream_client::connector::greedy_strategy< Connector >
(Template Class greedy_strategy)
Class Documentation¶
-
template<typename
Connector
>
classstream_client::connector
::
pool_strategy
¶ Interface for pool reconnection strategy.
Used by connection_pool to refill itself.
Subclassed by stream_client::connector::conservative_strategy< Connector >, stream_client::connector::greedy_strategy< Connector >
Public Types
-
using
stream_type
= typename connector_type::stream_type¶
-
using
append_func_type
= typename std::function<void(std::unique_ptr<stream_type> &&session)>¶
Public Functions
-
virtual
~pool_strategy
() = default¶ Destructor.
-
virtual bool
refill
(connector_type &connector, std::size_t vacant_places, append_func_type append_func) = 0¶ Creates new sessions via
connector
and add them to the pool up tovacant_places
times.- Parameters
connector – Connector to use for new sessions.
vacant_places – Number of required connection to fulfill the pool.
append_func – This function is used to add new one connected session to pool.
- Returns
true if all session have been successfully added.
-
using