5 #ifndef CVMFS_INGESTION_TASK_H_
6 #define CVMFS_INGESTION_TASK_H_
23 template<
typename ItemT>
31 template <
class ItemT>
40 virtual void Process(ItemT *item) = 0;
51 ItemT *item = consumer->
tube_->PopFront();
52 if (item->IsQuitBeacon()) {
64 template <
class ItemT>
70 for (
unsigned i = 0; i <
consumers_.size(); ++i)
83 for (
unsigned i = 0; i < N; ++i) {
84 int retval = pthread_create(
97 for (
unsigned i = 0; i < N; ++i) {
98 consumers_[i]->tube_->EnqueueBack(ItemT::CreateQuitBeacon());
100 for (
unsigned i = 0; i < N; ++i) {
101 int retval = pthread_join(
threads_[i], NULL);
115 #endif // CVMFS_INGESTION_TASK_H_
virtual void OnTerminate()
static void * MainConsumer(void *data)
std::vector< TubeConsumer< ItemT > * > consumers_
void TakeConsumer(TubeConsumer< ItemT > *consumer)
TubeConsumer(Tube< ItemT > *tube)
assert((mem||(size==0))&&"Out Of Memory")
std::vector< pthread_t > threads_
virtual void Process(ItemT *item)=0