mgmt+rib: use getScheduler() in RibManager and Readvertise

Refs: #4528
Change-Id: Ie6dd2b0fbe5d57cd7878d86b0185ae5d9bd92cf0
diff --git a/daemon/mgmt/rib-manager.cpp b/daemon/mgmt/rib-manager.cpp
index 8db60ab..a790775 100644
--- a/daemon/mgmt/rib-manager.cpp
+++ b/daemon/mgmt/rib-manager.cpp
@@ -27,6 +27,7 @@
 
 #include "core/fib-max-depth.hpp"
 #include "core/logger.hpp"
+#include "daemon/global.hpp"
 #include "rib/rib.hpp"
 
 #include <ndn-cxx/lp/tags.hpp>
@@ -47,13 +48,12 @@
 const Name RibManager::LOCALHOP_TOP_PREFIX = "/localhop/nfd";
 
 RibManager::RibManager(rib::Rib& rib, ndn::Face& face, ndn::KeyChain& keyChain,
-                       ndn::nfd::Controller& nfdController, Dispatcher& dispatcher, Scheduler& scheduler)
+                       ndn::nfd::Controller& nfdController, Dispatcher& dispatcher)
   : ManagerBase(MGMT_MODULE_NAME, dispatcher)
   , m_rib(rib)
   , m_keyChain(keyChain)
   , m_nfdController(nfdController)
   , m_dispatcher(dispatcher)
-  , m_scheduler(scheduler)
   , m_faceMonitor(face)
   , m_localhostValidator(face)
   , m_localhopValidator(face)
@@ -136,7 +136,7 @@
                " origin=" << route.origin << " cost=" << route.cost);
 
   if (expires) {
-    auto event = m_scheduler.schedule(*expires, [=] { m_rib.onRouteExpiration(name, route); });
+    auto event = getScheduler().schedule(*expires, [=] { m_rib.onRouteExpiration(name, route); });
     route.setExpirationEvent(event);
     NFD_LOG_TRACE("Scheduled unregistration at: " << *route.expires);
   }
@@ -458,7 +458,7 @@
 void
 RibManager::scheduleActiveFaceFetch(const time::seconds& timeToWait)
 {
-  m_activeFaceFetchEvent = m_scheduler.schedule(timeToWait, [this] { fetchActiveFaces(); });
+  m_activeFaceFetchEvent = getScheduler().schedule(timeToWait, [this] { fetchActiveFaces(); });
 }
 
 void
@@ -475,8 +475,8 @@
   // face destroyed events
   for (auto faceId : m_registeredFaces) {
     if (activeFaceIds.count(faceId) == 0) {
-      NFD_LOG_DEBUG("Removing invalid face ID: " << faceId);
-      m_scheduler.schedule(0_ns, [this, faceId] { this->onFaceDestroyedEvent(faceId); });
+      NFD_LOG_DEBUG("Removing invalid FaceId " << faceId);
+      getGlobalIoService().post([this, faceId] { onFaceDestroyedEvent(faceId); });
     }
   }
 
@@ -490,8 +490,8 @@
   NFD_LOG_TRACE("onNotification: " << notification);
 
   if (notification.getKind() == ndn::nfd::FACE_EVENT_DESTROYED) {
-    NFD_LOG_DEBUG("Received notification for destroyed faceId: " << notification.getFaceId());
-    m_scheduler.schedule(0_ns, [this, id = notification.getFaceId()] { onFaceDestroyedEvent(id); });
+    NFD_LOG_DEBUG("Received notification for destroyed FaceId " << notification.getFaceId());
+    getGlobalIoService().post([this, id = notification.getFaceId()] { onFaceDestroyedEvent(id); });
   }
 }