Stalls the execution of future HTTP requests inside consume().
| 995 | |
| 996 | // Stalls the execution of future HTTP requests inside consume(). |
| 997 | void pause() |
| 998 | { |
| 999 | // If there is no latch or if the existing latch has already been |
| 1000 | // triggered, create a new latch. |
| 1001 | if (latch.get() == nullptr || latch->await(Duration::min())) { |
| 1002 | latch.reset(new Latch()); |
| 1003 | } |
| 1004 | } |
| 1005 | |
| 1006 | void resume() |
| 1007 | { |