]>
Commit | Line | Data |
---|---|---|
11fdf7f2 TL |
1 | // -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*- |
2 | // vim: ts=8 sw=2 smarttab | |
3 | ||
4 | #pragma once | |
5 | ||
6 | #include <cstdint> | |
7 | ||
8 | class ThrottleInterface { | |
9 | public: | |
10 | virtual ~ThrottleInterface() {} | |
11 | /** | |
12 | * take the specified number of slots from the stock regardless the throttling | |
13 | * @param c number of slots to take | |
14 | * @returns the total number of taken slots | |
15 | */ | |
16 | virtual int64_t take(int64_t c = 1) = 0; | |
17 | /** | |
18 | * put slots back to the stock | |
19 | * @param c number of slots to return | |
20 | * @returns number of requests being hold after this | |
21 | */ | |
22 | virtual int64_t put(int64_t c = 1) = 0; | |
23 | }; |