Add unit test for timeout=0
[folly.git] / folly / futures / SharedPromise.h
index d1f8a94961621f442f9ec0b58e3ec4b2b5c2e153..d3b363efb4c5efd8a444f6bcf3c3773e27a4e5ac 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright 2016 Facebook, Inc.
+ * Copyright 2017 Facebook, Inc.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -16,8 +16,8 @@
 
 #pragma once
 
-#include <folly/futures/Promise.h>
 #include <folly/Portability.h>
+#include <folly/futures/Promise.h>
 
 namespace folly {
 
@@ -34,7 +34,7 @@ namespace folly {
  */
 template <class T>
 class SharedPromise {
-public:
+ public:
   SharedPromise() = default;
   ~SharedPromise() = default;
 
@@ -46,13 +46,6 @@ public:
   SharedPromise(SharedPromise<T>&&) noexcept;
   SharedPromise& operator=(SharedPromise<T>&&) noexcept;
 
-  /**
-   * Provide a way to split a Future<T>. Note that while the Futures from
-   * `getFuture()' depend on the completion of the parameter Future they do not
-   * inherit any other properties such as Executor's passed to `via' etc.
-   */
-  explicit SharedPromise(Future<T>);
-
   /**
    * Return a Future tied to the shared core state. Unlike Promise::getFuture,
    * this can be called an unlimited number of times per SharedPromise.
@@ -114,7 +107,7 @@ public:
 
   bool isFulfilled();
 
-private:
+ private:
   std::mutex mutex_;
   size_t size_{0};
   bool hasValue_{false};
@@ -123,7 +116,7 @@ private:
   std::function<void(exception_wrapper const&)> interruptHandler_;
 };
 
-}
+} // namespace folly
 
 #include <folly/futures/Future.h>
 #include <folly/futures/SharedPromise-inl.h>