Template Class greedy_strategy¶
Defined in File pool_strategy.hpp
Inheritance Relationships¶
Base Type¶
public stream_client::connector::pool_strategy< Connector >
(Template Class pool_strategy)
Class Documentation¶
-
template<typename
Connector
>
classstream_client::connector
::
greedy_strategy
: public stream_client::connector::pool_strategy<Connector>¶ Greedy strategy.
Will refill pool completely using multiple threads.
Public Types
-
using
connector_type
= typename pool_strategy<Connector>::connector_type¶
-
using
stream_type
= typename pool_strategy<Connector>::stream_type¶
-
using
append_func_type
= typename pool_strategy<Connector>::append_func_type¶
Public Functions
-
greedy_strategy
() = default¶
-
virtual
~greedy_strategy
() = default¶ Destructor.
-
virtual bool
refill
(connector_type &connector, std::size_t vacant_places, append_func_type append_func) override¶ Adds up to
vacant_places
sessions viaconnector
simultaneously.- Parameters
connector – Connector to use for new sessions.
vacant_places – Number of required connection to fulfill the pool.
append_func – Function is used to add new session to the pool.
- Returns
true if
vacant_places
> 0.
-
using