2 #ifndef CASS_QUERY_LIST__HPP
3 #define CASS_QUERY_LIST__HPP
42 static shared_ptr<CCassQueryList>
Create(shared_ptr<CCassConnection> cass_conn) noexcept;
57 void Cancel(
const exception* e =
nullptr);
59 void Execute(unique_ptr<ICassQueryListConsumer> consumer,
int retry_count,
bool post_async =
false);
61 void Yield(
bool wait);
62 shared_ptr<CCassQuery>
Extract(
size_t slot_index);
91 virtual void OnData()
override;
#define BEGIN_IDBLOB_SCOPE
BEGIN_IDBLOB_SCOPE USING_NCBI_SCOPE
function< void()> TCassQueryListTickCB
CCassOneExecConsumer(CCassOneExecConsumer &&)=delete
bool Start(shared_ptr< CCassQuery > query, CCassQueryList &list, size_t) override
CCassOneExecConsumer & operator=(const CCassOneExecConsumer &)=delete
void Reset(shared_ptr< CCassQuery >, CCassQueryList &, size_t) override
bool ProcessRow(shared_ptr< CCassQuery >, CCassQueryList &, size_t) override
CCassOneExecConsumer(function< bool(CCassQuery &query, CCassQueryList &list)> cb, function< void(CCassQuery &query, CCassQueryList &list, bool succeeded)> finish_cb=nullptr)
function< bool(CCassQuery &query, CCassQueryList &list)> m_cb
function< void(CCassQuery &query, CCassQueryList &list, bool succeeded)> m_finish_cb
void Failed(shared_ptr< CCassQuery >, CCassQueryList &, size_t, const exception *) override
CCassOneExecConsumer & operator=(CCassOneExecConsumer &&)=delete
bool Finish(shared_ptr< CCassQuery > query, CCassQueryList &list, size_t) override
CCassOneExecConsumer(const CCassOneExecConsumer &)=delete
weak_ptr< CCassQueryList > m_query_list
virtual void OnData() override
CQryNotification(shared_ptr< CCassQueryList > query_list, size_t index)
CCassQueryList::CQryNotification.
vector< shared_ptr< CQryNotification > > m_notification_arr
void DetachSlot(SQrySlot *slot)
static constexpr const unsigned int kResetRelaxTime
CCassQueryList & SetKeyspace(const string &keyspace)
atomic< thread::id > m_owning_thread
SQrySlot * CheckSlot(size_t index, bool discard)
void AttachSlot(SQrySlot *slot, SPendingSlot &&pending_slot)
void Release(SQrySlot *slot)
static constexpr const size_t kNotifyQueueLen
atomic_bool m_yield_in_progress
static constexpr const uint64_t kReadyPushWaitTimeout
vector< SPendingSlot > m_pending_arr
virtual ~CCassQueryList()
atomic_size_t m_attached_slots
weak_ptr< CCassQueryList > m_self_weak
void Execute(unique_ptr< ICassQueryListConsumer > consumer, int retry_count, bool post_async=false)
static shared_ptr< CCassQueryList > Create(shared_ptr< CCassConnection > cass_conn) noexcept
size_t NumberOfActiveQueries() const
shared_ptr< CCassConnection > m_cass_conn
shared_ptr< CCassQuery > Extract(size_t slot_index)
size_t NumberOfBusySlots() const
vector< SQrySlot > m_query_arr
void CheckPending(SQrySlot *slot)
string GetKeyspace() const
size_t GetMaxQueries() const
void ReadRows(SQrySlot *slot)
TCassQueryListTickCB m_tick_cb
SQrySlot * CheckSlots(bool discard, bool wait=true)
size_t NumberOfPendingSlots() const
CCassQueryList & SetTickCB(TCassQueryListTickCB cb)
static string SQrySlotStateStr[ssLast]
CCassQueryList.
CCassQueryList & SetMaxQueries(size_t max_queries)
static constexpr const unsigned int kDfltMaxQuery
static constexpr const uint64_t kReadyPopWaitTimeout
void Cancel(const exception *e=nullptr)
mpmc_bounded_queue_w< size_t, kNotifyQueueLen > m_ready
ICassQueryListConsumer & operator=(ICassQueryListConsumer &&)=delete
virtual bool Finish(shared_ptr< CCassQuery >, CCassQueryList &, size_t)
ICassQueryListConsumer & operator=(const ICassQueryListConsumer &)=delete
virtual bool Start(shared_ptr< CCassQuery > query, CCassQueryList &list, size_t query_idx)=0
virtual bool ProcessRow(shared_ptr< CCassQuery > query, CCassQueryList &list, size_t query_idx)=0
ICassQueryListConsumer(const ICassQueryListConsumer &)=delete
virtual ~ICassQueryListConsumer()=default
ICassQueryListConsumer(ICassQueryListConsumer &&)=delete
ICassQueryListConsumer()=default
virtual void Failed(shared_ptr< CCassQuery > query, CCassQueryList &list, size_t query_idx, const exception *e)=0
virtual void Reset(shared_ptr< CCassQuery >, CCassQueryList &, size_t)
unique_ptr< ICassQueryListConsumer > m_consumer
shared_ptr< CCassQuery > m_qry
unique_ptr< ICassQueryListConsumer > m_consumer