/*
- * Copyright 2014 Facebook, Inc.
+ * Copyright 2015 Facebook, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <folly/futures/detail/Types.h>
-namespace folly { namespace wangle {
+namespace folly {
-template <class> struct Future;
+template <class> class Future;
/// A Timekeeper handles the details of keeping time and fulfilling delay
/// promises. The returned Future<void> will either complete after the
Future<void> at(std::chrono::time_point<Clock> when);
};
-}}
+} // namespace folly
// now get those definitions
#include <folly/futures/Future.h>
// finally we can use Future
-namespace folly { namespace wangle {
+namespace folly {
- template <class Clock>
- Future<void> Timekeeper::at(std::chrono::time_point<Clock> when) {
- auto now = Clock::now();
-
- if (when <= now) {
- return makeFuture();
- }
+template <class Clock>
+Future<void> Timekeeper::at(std::chrono::time_point<Clock> when) {
+ auto now = Clock::now();
- return after(when - now);
+ if (when <= now) {
+ return makeFuture();
}
-}}
+ return after(when - now);
+}
+
+} // namespace folly