westonpace commented on a change in pull request #10258:
URL: https://github.com/apache/arrow/pull/10258#discussion_r645781862
##########
File path: cpp/src/arrow/util/test_common.h
##########
@@ -85,4 +88,18 @@ inline void AssertIteratorExhausted(Iterator<T>& it) {
Transformer<TestInt, TestStr> MakeFilter(std::function<bool(TestInt&)> filter);
+class MockExecutor : public internal::Executor {
Review comment:
I went ahead and added `executor_util.h`.
##########
File path: cpp/src/arrow/util/future.h
##########
@@ -202,8 +202,30 @@ enum class FutureState : int8_t { PENDING, SUCCESS,
FAILURE };
inline bool IsFutureFinished(FutureState state) { return state !=
FutureState::PENDING; }
+/// \brief Describes whether the callback should be scheduled or run
synchronously
Review comment:
Fixed.
##########
File path: cpp/src/arrow/util/future.h
##########
@@ -202,8 +202,30 @@ enum class FutureState : int8_t { PENDING, SUCCESS,
FAILURE };
inline bool IsFutureFinished(FutureState state) { return state !=
FutureState::PENDING; }
+/// \brief Describes whether the callback should be scheduled or run
synchronously
+enum ShouldSchedule {
+ /// Always run the callback synchronously (the default)
+ NEVER = 0,
+ /// Schedule a new task only if the future is not finished when the
+ /// callback is added
+ IF_UNFINISHED = 1,
+ /// Always schedule the callback as a new task
+ ALWAYS = 2
+};
+
+/// \brief Options that control how a continuation is run
+struct CallbackOptions {
+ /// Describes whether the callback should be run synchronously or scheduled
Review comment:
Fixed.
--
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]