{
public:
static Distributor *Create(int n=1); //!< Create a new Distributor with \param n threads
-
- virtual void cleanup();
- virtual int question(Question *, void (*)(const AnswerData<Answer> &)) =0; //!< Submit a question to the Distributor
- virtual void getQueueSizes(int &questions, int &answers) =0; //!< Returns length of question queue
-
- virtual int getNumBusy() =0;
-
+ typedef std::function<void(Answer*)> callback_t;
+ virtual int question(Question *, callback_t callback) =0; //!< Submit a question to the Distributor
+ virtual int getQueueSize() =0; //!< Returns length of question queue
virtual bool isOverloaded() =0;
--
-private:
};
template<class Answer, class Question, class Backend> class SingleThreadDistributor