| 142 | typename FutureType = typename ::arrow::detail::ContinueFuture::ForSignature< |
| 143 | Function && (Args && ...)>> |
| 144 | Result<FutureType> Submit(TaskHints hints, StopToken stop_token, Function&& func, |
| 145 | Args&&... args) { |
| 146 | using ValueType = typename FutureType::ValueType; |
| 147 | |
| 148 | auto future = FutureType::Make(); |
| 149 | auto task = std::bind(::arrow::detail::ContinueFuture{}, future, |
| 150 | std::forward<Function>(func), std::forward<Args>(args)...); |
| 151 | struct { |
| 152 | WeakFuture<ValueType> weak_fut; |
| 153 | |
| 154 | void operator()(const Status& st) { |
| 155 | auto fut = weak_fut.get(); |
| 156 | if (fut.is_valid()) { |
| 157 | fut.MarkFinished(st); |
| 158 | } |
| 159 | } |
| 160 | } stop_callback{WeakFuture<ValueType>(future)}; |
| 161 | ARROW_RETURN_NOT_OK(SpawnReal(hints, std::move(task), std::move(stop_token), |
| 162 | std::move(stop_callback))); |
| 163 | |
| 164 | return future; |
| 165 | } |
| 166 | |
| 167 | template <typename Function, typename... Args, |
| 168 | typename FutureType = typename ::arrow::detail::ContinueFuture::ForSignature< |
nothing calls this directly
no test coverage detected