#include <swcdb/db/client/service/bkr/Brokers.h>
Classes | |
struct | BrokerIdx |
Public Types | |
typedef Core::Vector< Comm::EndPoints > | BrokersEndPoints |
Public Member Functions | |
SWC_CAN_INLINE | Brokers () noexcept |
Brokers (const Config::Settings &settings, Comm::IoContextPtr ioctx, const ContextBroker::Ptr &bkr_ctx) | |
Brokers (const Brokers &)=delete | |
Brokers & | operator= (const Brokers &)=delete |
~Brokers () noexcept | |
void | on_cfg_update () noexcept |
size_t | size () noexcept |
bool | get (BrokerIdx &idx, Comm::EndPoints &endpoints) |
bool | has_endpoints () noexcept |
void | set (BrokersEndPoints &&endpoints) |
void | set (const BrokersEndPoints &endpoints) |
bool | put (const Comm::client::ConnQueue::ReqBase::Ptr &req, BrokerIdx &idx) |
Public Attributes | |
const Comm::client::ConnQueuesPtr | queues |
const Config::Property::Value_strings_g::Ptr | cfg_hosts |
const uint16_t | cfg_port |
Private Attributes | |
Core::MutexSptd | m_mutex |
BrokersEndPoints | m_brokers |
|
inlinenoexcept |
SWC::client::Brokers::Brokers | ( | const Config::Settings & | settings, |
Comm::IoContextPtr | ioctx, | ||
const ContextBroker::Ptr & | bkr_ctx | ||
) |
Definition at line 12 of file Brokers.cc.
References on_cfg_update().
|
delete |
bool SWC::client::Brokers::get | ( | Brokers::BrokerIdx & | idx, |
Comm::EndPoints & | endpoints | ||
) |
Definition at line 103 of file Brokers.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), m_brokers, m_mutex, SWC::client::Brokers::BrokerIdx::pos, and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().
|
noexcept |
Definition at line 112 of file Brokers.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Core::Vector< T, SizeT, GROW_SZ >::front(), m_brokers, and m_mutex.
|
noexcept |
Definition at line 40 of file Brokers.cc.
References cfg_hosts, cfg_port, SWC::Core::Vector< T, SizeT, GROW_SZ >::emplace_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::Config::Property::from_string(), SWC::Config::Property::Value_strings_g::get(), SWC::Comm::Resolver::get_endpoints(), SWC::Comm::Resolver::is_ipv4_address(), SWC::Comm::Resolver::is_ipv6_address(), SWC::LOG_DEBUG, SWC::Core::Vector< T, SizeT, GROW_SZ >::push_back(), SWC::Core::Vector< T, SizeT, GROW_SZ >::reserve(), set(), SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), SWC_LOG_CURRENT_EXCEPTION, SWC_LOG_OSTREAM, and SWC_LOG_OUT.
Referenced by Brokers().
bool SWC::client::Brokers::put | ( | const Comm::client::ConnQueue::ReqBase::Ptr & | req, |
Brokers::BrokerIdx & | idx | ||
) |
Definition at line 127 of file Brokers.cc.
References SWC::Core::Vector< T, SizeT, GROW_SZ >::empty(), SWC::LOG_ERROR, m_brokers, m_mutex, SWC::client::Brokers::BrokerIdx::pos, queues, SWC::Core::Vector< T, SizeT, GROW_SZ >::size(), and SWC_LOG.
void SWC::client::Brokers::set | ( | BrokersEndPoints && | endpoints | ) |
Definition at line 117 of file Brokers.cc.
References m_brokers, and m_mutex.
Referenced by on_cfg_update().
void SWC::client::Brokers::set | ( | const BrokersEndPoints & | endpoints | ) |
Definition at line 122 of file Brokers.cc.
|
noexcept |
Definition at line 98 of file Brokers.cc.
References m_brokers, m_mutex, and SWC::Core::Vector< T, SizeT, GROW_SZ >::size().
const Config::Property::Value_strings_g::Ptr SWC::client::Brokers::cfg_hosts |
Definition at line 61 of file Brokers.h.
Referenced by SWC::client::Clients::init(), and on_cfg_update().
const uint16_t SWC::client::Brokers::cfg_port |
Definition at line 62 of file Brokers.h.
Referenced by on_cfg_update().
|
private |
|
private |
const Comm::client::ConnQueuesPtr SWC::client::Brokers::queues |
Definition at line 60 of file Brokers.h.
Referenced by SWC::client::Clients::get_bkr_io(), SWC::client::Clients::get_bkr_queue(), SWC::client::Clients::has_brokers(), put(), and SWC::client::Clients::stop_services().