Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

pqxx::pipeline Class Reference

Processes several queries in FIFO manner, optimized for high throughput. More...

#include <pipeline.hxx>

List of all members.

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, resultretrieve (query_id)
 Retrieve result for given query.

result retrieve ()
 Retrieve oldest unretrieved result (possibly wait for one).

bool empty () const throw ()


Detailed Description

Processes several queries in FIFO manner, optimized for high throughput.

Warning:
This is an early prototype, not functional code, and it will most likely change radically before becoming part of the library.
Use a pipeline if you want to execute several queries in succession, in situations where some of the queries do not depend on the outcome of the preceding one. Result retrieval is decoupled from execution request; queries "go in at the front" and results "come out the back." In fact, results may be retrieved in any order--but this will typically be slower than sticking to the order in which they were entered.

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!


Member Typedef Documentation

typedef unsigned pqxx::pipeline::query_id
 


Constructor & Destructor Documentation

pqxx::pipeline::pipeline transaction_base t  )  [explicit]
 


Member Function Documentation

void pqxx::pipeline::cancel query_id   ) 
 

Cancel given query.

void pqxx::pipeline::drain  ) 
 

Wait for all ongoing or pending operations to complete.

bool pqxx::pipeline::empty  )  const throw ()
 

void pqxx::pipeline::flush  ) 
 

Forget all pending operations, try to cancel current one.

pqxx::pipeline::query_id pqxx::pipeline::insert const PGSTD::string &   ) 
 

Add query to the pipeline.

bool pqxx::pipeline::is_finished query_id   )  const
 

Is result for given query available?

bool pqxx::pipeline::is_running query_id   )  const
 

Has given query started yet?

result pqxx::pipeline::retrieve  ) 
 

Retrieve oldest unretrieved result (possibly wait for one).

PGSTD::pair<query_id, result> pqxx::pipeline::retrieve query_id   ) 
 

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.


The documentation for this class was generated from the following files:
Generated on Thu Dec 25 07:16:40 2003 for libpqxx by doxygen 1.3.4