| 425 | }; |
| 426 | |
| 427 | Result<Future<>> operator()() { |
| 428 | Future<> task = Future<>::Make(); |
| 429 | // Consume as many items as we can (those that are already finished) |
| 430 | // synchronously to avoid recursion / stack overflow. |
| 431 | while (true) { |
| 432 | Future<T> next = state_holder->generator(); |
| 433 | if (next.TryAddCallback( |
| 434 | [&] { return SubmitTaskCallback(std::move(state_holder), task); })) { |
| 435 | return task; |
| 436 | } |
| 437 | ARROW_ASSIGN_OR_RAISE(T item, next.result()); |
| 438 | if (IsIterationEnd(item)) { |
| 439 | task.MarkFinished(); |
| 440 | return task; |
| 441 | } |
| 442 | ARROW_RETURN_NOT_OK(state_holder->visitor(item)); |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | std::string_view name() const { return state_holder->name; } |
| 447 |
nothing calls this directly
no test coverage detected