Give each eventbase a wheeltimer
[folly.git] / folly / io / async / TimeoutManager.h
index fb3a1b0e74dd6c5acf7e409269b8090d6b484f0f..e7df72e9893edfa4d221f3506c87683011548efe 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2016 Facebook, Inc.
  *
  * Licensed to the Apache Software Foundation (ASF) under one
  * or more contributor license agreements. See the NOTICE file
@@ -34,12 +34,14 @@ class AsyncTimeout;
  */
 class TimeoutManager {
  public:
+  typedef std::chrono::milliseconds timeout_type;
+
   enum class InternalEnum {
     INTERNAL,
     NORMAL
   };
 
-  virtual ~TimeoutManager() {}
+  virtual ~TimeoutManager() = default;
 
   /**
    * Attaches/detaches TimeoutManager to AsyncTimeout
@@ -52,7 +54,7 @@ class TimeoutManager {
    * Schedules AsyncTimeout to fire after `timeout` milliseconds
    */
   virtual bool scheduleTimeout(AsyncTimeout* obj,
-                               std::chrono::milliseconds timeout) = 0;
+                               timeout_type timeout) = 0;
 
   /**
    * Cancels the AsyncTimeout, if scheduled
@@ -63,7 +65,7 @@ class TimeoutManager {
    * This is used to mark the beginning of a new loop cycle by the
    * first handler fired within that cycle.
    */
-  virtual bool bumpHandlingTime() = 0;
+  virtual void bumpHandlingTime() = 0;
 
   /**
    * Helper method to know whether we are running in the timeout manager