shared executor in Fetchers
diff --git a/src/fetch-manager.cc b/src/fetch-manager.cc
index a883118..4fbe5bc 100644
--- a/src/fetch-manager.cc
+++ b/src/fetch-manager.cc
@@ -45,8 +45,10 @@
, m_maxParallelFetches (parallelFetches)
, m_currentParallelFetches (0)
, m_scheduler (new Scheduler)
+ , m_executor (new Executor(1))
{
m_scheduler->start ();
+ m_executor->start();
m_scheduleFetchesTask = Scheduler::schedulePeriodicTask (m_scheduler,
make_shared<SimpleIntervalGenerator> (300), // no need to check to often. if needed, will be rescheduled
@@ -57,6 +59,8 @@
{
m_scheduler->shutdown ();
+ m_executor->shutdown();
+
m_fetchList.clear_and_dispose (fetcher_disposer ());
}
@@ -76,6 +80,7 @@
forwardingHint = m_mapping (deviceName);
Fetcher &fetcher = *(new Fetcher (m_ccnx,
+ m_executor,
segmentCallback,
finishCallback,
bind (&FetchManager::DidFetchComplete, this, _1),