#include <pipeline.hxx>
Public Types | |
typedef unsigned | query_id |
Public Member Functions | |
pipeline (transaction_base &t) | |
query_id | insert (const PGSTD::string &) |
Add query to the pipeline. | |
void | drain () |
Wait for all ongoing or pending operations to complete. | |
void | flush () |
Forget all pending operations, try to cancel current one. | |
void | cancel (query_id) |
Cancel given query. | |
bool | is_running (query_id) const |
Has given query started yet? | |
bool | is_finished (query_id) const |
Is result for given query available? | |
PGSTD::pair< query_id, result > | retrieve (query_id) |
Retrieve result for given query. | |
result | retrieve () |
Retrieve oldest unretrieved result (possibly wait for one). | |
bool | empty () const throw () |
Feel free to pump as many queries into the pipeline as possible, even if they were generated after looking at a result from the same pipeline. To get the best possible throughput, try to make insertion of queries run as far ahead of results retrieval as possible; issue each query as early as possible and retrieve their results as late as possible, so the pipeline has as many ongoing queries as possible at any given time. In other words, keep it busy!
|
|
|
|
|
Cancel given query.
|
|
Wait for all ongoing or pending operations to complete.
|
|
|
|
Forget all pending operations, try to cancel current one.
|
|
Add query to the pipeline.
|
|
Is result for given query available?
|
|
Has given query started yet?
|
|
Retrieve oldest unretrieved result (possibly wait for one).
|
|
Retrieve result for given query. If the query failed for whatever reason, this will throw an exception. The function will block if the query has not finished yet. |