| 59 | } |
| 60 | |
| 61 | void QueryContext::ScheduleTask(std::function<Status()> fn, std::string_view name) { |
| 62 | ::arrow::internal::Executor* exec = executor(); |
| 63 | // Adds a task which submits fn to the executor and tracks its progress. If we're |
| 64 | // already stopping then the task is ignored and fn is not executed. |
| 65 | async_scheduler_->AddSimpleTask( |
| 66 | [exec, fn = std::move(fn)]() mutable { return exec->Submit(std::move(fn)); }, name); |
| 67 | } |
| 68 | |
| 69 | void QueryContext::ScheduleTask(std::function<Status(size_t)> fn, std::string_view name) { |
| 70 | std::function<Status()> indexed_fn = [this, fn]() { |