Yields items with a small pause between each one from a background thread
| 53 | |
| 54 | // Yields items with a small pause between each one from a background thread |
| 55 | std::function<Future<TestInt>()> BackgroundAsyncVectorIt( |
| 56 | std::vector<TestInt> v, bool sleep = true, int max_q = kDefaultBackgroundMaxQ, |
| 57 | int q_restart = kDefaultBackgroundQRestart) { |
| 58 | auto pool = internal::GetCpuThreadPool(); |
| 59 | auto slow_iterator = PossiblySlowVectorIt(v, sleep); |
| 60 | EXPECT_OK_AND_ASSIGN( |
| 61 | auto background, |
| 62 | MakeBackgroundGenerator<TestInt>(std::move(slow_iterator), pool, max_q, q_restart)); |
| 63 | return MakeTransferredGenerator(background, pool); |
| 64 | } |
| 65 | |
| 66 | std::function<Future<TestInt>()> NewBackgroundAsyncVectorIt(std::vector<TestInt> v, |
| 67 | bool sleep = true) { |
no test coverage detected