public class ThrottleRequestFilter extends Object implements RequestFilter
RequestFilter
throttles requests and block when the number of permits is reached, waiting for
the response to arrives before executing the next request.Constructor and Description |
---|
ThrottleRequestFilter(int maxConnections) |
ThrottleRequestFilter(int maxConnections,
int maxWait) |
Modifier and Type | Method and Description |
---|---|
FilterContext |
filter(FilterContext ctx)
An
AsyncHttpProvider will invoke RequestFilter.filter(com.ning.http.client.filter.FilterContext) and will use the
returned FilterContext.getRequest() and FilterContext.getAsyncHandler() to continue the request
processing. |
public ThrottleRequestFilter(int maxConnections)
public ThrottleRequestFilter(int maxConnections, int maxWait)
public FilterContext filter(FilterContext ctx) throws FilterException
RequestFilter
AsyncHttpProvider
will invoke RequestFilter.filter(com.ning.http.client.filter.FilterContext)
and will use the
returned FilterContext.getRequest()
and FilterContext.getAsyncHandler()
to continue the request
processing.filter
in interface RequestFilter
ctx
- a FilterContext
FilterContext
. The FilterContext
instance may not the same as the original one.FilterException
- to interrupt the filter processing.Copyright © 2014. All Rights Reserved.