| 51 | label(std::move(label)), |
| 52 | noisy(noisy) {} |
| 53 | std::optional<ExecBatch> Next() { |
| 54 | Result<std::optional<ExecBatch>> opt_batch_res = batch_it.Next(); |
| 55 | if (!opt_batch_res.ok()) { |
| 56 | return std::nullopt; |
| 57 | } |
| 58 | std::optional<ExecBatch> opt_batch = opt_batch_res.ValueOrDie(); |
| 59 | if (!opt_batch) { |
| 60 | return std::nullopt; |
| 61 | } |
| 62 | if (noisy) { |
| 63 | std::cout << label + ": asking for batch(" + std::to_string(index) + ")\n"; |
| 64 | } |
| 65 | SleepFor(delay_sec); |
| 66 | ++index; |
| 67 | return *opt_batch; |
| 68 | } |
| 69 | |
| 70 | Iterator<std::optional<ExecBatch>> batch_it; |
| 71 | double delay_sec; |
no test coverage detected