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