blob: fa1660d99e60d3729ac8fb52e2d74c6f30c21de6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
// Copyright Verizon Media. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package ai.vespa.feed.client;
import java.util.concurrent.CompletableFuture;
/**
* Determines the number of requests to have inflight at any point.
*
* @author jonmv
*/
interface Throttler {
/**
* A request was just sent with {@code vessel}, with {@code inflight} total in flight.
*/
void sent(long inflight, CompletableFuture<HttpResponse> vessel);
/**
* A successful response was obtained.
*/
void success();
/**
* A throttle signal was obtained from the server.
*/
void throttled(long inflight);
/**
* The target inflight operations right now.
*/
long targetInflight();
}
|