pdns  4.2.0-rc1
About: PowerDNS daemon - a high performance authoritative nameserver. Release candidate.
  Fossies Dox: pdns-4.2.0-rc1.tar.bz2  ("inofficial" and yet experimental doxygen-generated source code documentation)  

Distributor< Answer, Question, Backend > Class Template Referenceabstract

#include <distributor.hh>

Inheritance diagram for Distributor< Answer, Question, Backend >:

Public Types

typedef std::function< void(Answer *)> callback_t
 

Public Member Functions

virtual int question (Question *, callback_t callback)=0
 Submit a question to the Distributor. More...
 
virtual int getQueueSize ()=0
 Returns length of question queue. More...
 
virtual bool isOverloaded ()=0
 

Static Public Member Functions

static DistributorCreate (int n=1)
 Create a new Distributor with. More...
 

Detailed Description

template<class Answer, class Question, class Backend>
class Distributor< Answer, Question, Backend >

the Distributor template class enables you to multithread slow question/answer processes.

Questions are posed to the Distributor, which returns the answer via a callback.

The Distributor spawns sufficient backends, and if they thrown an exception, it will cycle the backend but drop the query that was active during the exception.

Definition at line 51 of file distributor.hh.

Member Typedef Documentation

◆ callback_t

template<class Answer , class Question , class Backend >
typedef std::function<void(Answer*)> Distributor< Answer, Question, Backend >::callback_t

Definition at line 55 of file distributor.hh.

Member Function Documentation

◆ Create()

template<class Answer , class Question , class Backend >
Distributor< Answer, Question, Backend > * Distributor< Answer, Question, Backend >::Create ( int  n = 1)
static

Create a new Distributor with.

Parameters
nthreads

Definition at line 122 of file distributor.hh.

Referenced by BOOST_AUTO_TEST_CASE(), and qthread().

◆ getQueueSize()

template<class Answer , class Question , class Backend >
virtual int Distributor< Answer, Question, Backend >::getQueueSize ( )
pure virtual

◆ isOverloaded()

template<class Answer , class Question , class Backend >
virtual bool Distributor< Answer, Question, Backend >::isOverloaded ( )
pure virtual

◆ question()

template<class Answer , class Question , class Backend >
virtual int Distributor< Answer, Question, Backend >::question ( Question ,
callback_t  callback 
)
pure virtual

The documentation for this class was generated from the following file: