| 375 | class CustomThrottle : public ThrottledAsyncTaskScheduler::Throttle { |
| 376 | public: |
| 377 | virtual std::optional<Future<>> TryAcquire(int amt) { |
| 378 | if (gate_.is_finished()) { |
| 379 | return std::nullopt; |
| 380 | } else { |
| 381 | return gate_; |
| 382 | } |
| 383 | } |
| 384 | virtual void Release(int amt) {} |
| 385 | void Unlock() { gate_.MarkFinished(); } |
| 386 | int Capacity() { return std::numeric_limits<int>::max(); } |
nothing calls this directly
no test coverage detected