Template Class greedy_strategy

Inheritance Relationships

Base Type

Class Documentation

template<typename Connector>
class stream_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 via connector 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.