/*
- * 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
*/
class TimeoutManager {
public:
+ typedef std::chrono::milliseconds timeout_type;
+
enum class InternalEnum {
INTERNAL,
NORMAL
};
- virtual ~TimeoutManager() {}
+ virtual ~TimeoutManager() = default;
/**
* Attaches/detaches TimeoutManager to AsyncTimeout
* 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
* 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