bkietz commented on a change in pull request #8591:
URL: https://github.com/apache/arrow/pull/8591#discussion_r519864564



##########
File path: cpp/src/arrow/util/future.h
##########
@@ -310,63 +229,66 @@ class Future {
     return impl_->Wait(seconds);
   }
 
-  /// If a Result<Future> holds an error instead of a Future, construct a 
finished Future
-  /// holding that error.
-  static Future DeferNotOk(Result<Future> maybe_future) {
-    if (ARROW_PREDICT_FALSE(!maybe_future.ok())) {
-      return MakeFinished(std::move(maybe_future).status());
-    }
-    return std::move(maybe_future).MoveValueUnsafe();
-  }
-
   // Producer API
 
-  /// \brief Producer API: execute function and mark Future finished
-  ///
-  /// The function's return value is used to set the Future's result.
-  /// The function can have the following return types:
-  /// - `T`
-  /// - `Result<T>`, if T is neither `void` nor `Status`
-  template <typename Func>
-  void ExecuteAndMarkFinished(Func&& func) {
-    storage_->ExecuteAndMarkFinished(std::forward<Func>(func));
-  }
-
   /// \brief Producer API: mark Future finished
   ///
-  /// The arguments are used to set the Future's result.
-  /// This function accepts the following signatures:
-  /// - `(T val)`, if T is neither `void` nor `Status`
-  /// - `(Result<T> val)`, if T is neither `void` nor `Status`
-  /// - `(Status st)`, if T is `void` or `Status`
-  /// - `()`, if T is `void`
-  template <typename... Args>
-  void MarkFinished(Args&&... args) {
-    storage_->MarkFinished(std::forward<Args>(args)...);
+  /// The Future's result is set to `res`.
+  void MarkFinished(Result<ValueType> res) { DoMarkFinished(std::move(res)); }
+
+  /// \brief Mark a Future<> or Future<> completed with the provided Status.

Review comment:
       `fastmod` failure, I'll remove the duplicate




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to