Serializing FillPipeline in Fetcher
:
diff --git a/src/fetcher.cc b/src/fetcher.cc
index b7f6e35..65b0ed8 100644
--- a/src/fetcher.cc
+++ b/src/fetcher.cc
@@ -64,11 +64,14 @@
   , m_activePipeline (0)
   , m_retryPause (0)
   , m_nextScheduledRetry (date_time::second_clock<boost::posix_time::ptime>::universal_time ())
+  , m_executor (1) // must be 1
 {
+  m_executor.start ();
 }
 
 Fetcher::~Fetcher ()
 {
+  m_executor.shutdown ();
 }
 
 void
@@ -79,10 +82,7 @@
   // cout << "Restart: " << m_minSendSeqNo << endl;
   m_lastPositiveActivity = date_time::second_clock<boost::posix_time::ptime>::universal_time();
 
-  // Scheduler::scheduleOneTimeTask ();
-  // m_scheduler
-  // m_executor.execute (bind (&Fetcher::FillPipeline, this));
-  FillPipeline ();
+  m_executor.execute (bind (&Fetcher::FillPipeline, this));
 }
 
 void
@@ -192,8 +192,7 @@
     }
   else
     {
-      FillPipeline ();
-      // m_executor.execute (bind (&Fetcher::FillPipeline, this));
+      m_executor.execute (bind (&Fetcher::FillPipeline, this));
     }
 }
 
diff --git a/src/fetcher.h b/src/fetcher.h
index 53d8562..74e3ce4 100644
--- a/src/fetcher.h
+++ b/src/fetcher.h
@@ -124,6 +124,8 @@
 
   double m_retryPause; // pause to stop trying to fetch (for fetch-manager)
   boost::posix_time::ptime m_nextScheduledRetry;
+
+  Executor m_executor; // to serialize FillPipeline events
 };
 
 typedef boost::error_info<struct tag_errmsg, std::string> errmsg_info_str;