Search Toolkit Book for CPSG_Queue
A queue to retrieve data (accession resolution info; bio-sequence; annotation blobs) from the storage. More...
#include <objtools/pubseq_gateway/client/psg_client.hpp>
A queue to retrieve data (accession resolution info; bio-sequence; annotation blobs) from the storage.
Call SendRequest() to schedule retrievals (by their bio-ids or blob-ids). Then, call GetNextReply() to get the next reply whose data has started coming in.
All methods are MT-safe. Data from different replies can be read in parallel.
The queue object can be used from more than one thread, either to push requests or to get the incoming ready-to-be-retrieved replies.
Results for the requests which were pushed into a given instance of the queue will be available for retrieval using this (and only this) queue instance regardless of which threads were used to push the request to the queue.
If more than one request was pushed into the queue, then the replies to all of the requests may come, in any order.
Definition at line 1217 of file psg_client.hpp.
◆ TApiLockGet an API lock.
Holding this API lock is essential if numerous short-lived queue instances are used. It prevents an internal I/O implementation (threads, TCP connections, HTTP sessions, etc) from being destroyed (on destroying last remaining queue instance) and then re-created (with new queue instance).
Definition at line 1321 of file psg_client.hpp.
◆ CPSG_Queue() [1/3] CPSG_Queue::CPSG_Queue ( ) defaultCreates an uninitialized instance.
It allows to postpone queue initialization until later. The uninitialized instances can then be initialized using regular constructor and move assignment operator.
◆ CPSG_Queue() [2/3]Definition at line 1498 of file psg_client.cpp.
◆ ~CPSG_Queue() CPSG_Queue::~CPSG_Queue ( ) default ◆ CPSG_Queue() [3/3] ◆ GetApiLock() ◆ GetNextReply()Get the next reply which has started arriving from the server.
Definition at line 1509 of file psg_client.cpp.
References _ASSERT, and m_Impl.
Referenced by CPSG_EventLoop::RunOnce().
◆ IsEmpty() bool CPSG_Queue::IsEmpty ( void ) const ◆ IsInitialized() bool CPSG_Queue::IsInitialized ( void ) const inline ◆ operator=() ◆ RejectsRequests() bool CPSG_Queue::RejectsRequests ( ) constIs the queue in a state (possibly temporary) when requests get immediately rejected.
Definition at line 1551 of file psg_client.cpp.
References _ASSERT, and m_Impl.
◆ Reset() void CPSG_Queue::Reset ( void ) ◆ SendRequest()Push request into the queue.
Definition at line 1503 of file psg_client.cpp.
References _ASSERT, and m_Impl.
Referenced by EventLoop(), CProcessing::OneRequest(), and CPSGL_Queue::SendRequest().
◆ SendRequestAndGetReply() ◆ SetRequestFlags() void CPSG_Queue::SetRequestFlags ( CPSG_Request::TFlags request_flags ) ◆ SetUserArgs() ◆ Stop() void CPSG_Queue::Stop ( void ) ◆ WaitForEvents()Wait for events on this queue, on replies returned by this queue and/or on reply items returned by the replies returned by this queue.
Definition at line 1531 of file psg_client.cpp.
References _ASSERT, and m_Impl.
Referenced by CPSG_EventLoop::RunOnce().
◆ m_Impl unique_ptr<SImpl> CPSG_Queue::m_Impl privateDefinition at line 1330 of file psg_client.hpp.
Referenced by CPSG_ReplyItem::GetNextMessage(), GetNextReply(), CPSG_ReplyItem::GetStatus(), IsEmpty(), IsInitialized(), RejectsRequests(), Reset(), SendRequest(), SendRequestAndGetReply(), SetRequestFlags(), SetUserArgs(), Stop(), and WaitForEvents().
The documentation for this class was generated from the following files:
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4