* Starts more file reads without flooding the main thread.
()
| 56 | * Starts more file reads without flooding the main thread. |
| 57 | */ |
| 58 | function pump() { |
| 59 | pumpScheduled = false; |
| 60 | while (active < MAX_CONCURRENT_FILE_READS && cursor < total) { |
| 61 | const file = files[cursor++]; |
| 62 | active += 1; |
| 63 | processFile(file); |
| 64 | } |
| 65 | } |
| 66 | |
| 67 | function schedulePump() { |
| 68 | if (pumpScheduled) return; |
no test coverage detected