| Package | Description |
|---|---|
| com.linecorp.armeria.server.throttling |
Request throttling service decorators and strategies.
|
| Modifier and Type | Class and Description |
|---|---|
class |
RateLimitingThrottlingStrategy<T extends Request>
A
ThrottlingStrategy that provides a throttling strategy based on QPS. |
| Modifier and Type | Method and Description |
|---|---|
static <T extends Request> |
ThrottlingStrategy.always()
Returns a singleton
ThrottlingStrategy that always accepts requests. |
static <T extends Request> |
ThrottlingStrategy.never()
Returns a singleton
ThrottlingStrategy that never accepts requests. |
static <T extends Request> |
ThrottlingStrategy.of(BiFunction<ServiceRequestContext,T,CompletionStage<Boolean>> function)
Creates a new
ThrottlingStrategy that determines whether a request should be accepted or not
using a given BiFunction instance. |
static <T extends Request> |
ThrottlingStrategy.of(BiFunction<ServiceRequestContext,T,CompletionStage<Boolean>> function,
String strategyName)
Creates a new
ThrottlingStrategy that determines whether a request should be accepted or not
using a given BiFunction instance. |
| Modifier and Type | Method and Description |
|---|---|
static Function<? super HttpService,ThrottlingService> |
ThrottlingService.newDecorator(ThrottlingStrategy<HttpRequest> strategy)
Creates a new decorator using the specified
ThrottlingStrategy instance. |
static Function<? super RpcService,ThrottlingRpcService> |
ThrottlingRpcService.newDecorator(ThrottlingStrategy<RpcRequest> strategy)
Creates a new decorator using the specified
ThrottlingStrategy instance. |
| Constructor and Description |
|---|
AbstractThrottlingService(Service<I,O> delegate,
ThrottlingStrategy<I> strategy,
Function<CompletionStage<? extends O>,O> responseConverter)
Creates a new instance that decorates the specified
Service. |
ThrottlingRpcService(RpcService delegate,
ThrottlingStrategy<RpcRequest> strategy)
Creates a new instance that decorates the specified
Service. |
Copyright © 2020 LeanCloud. All rights reserved.