public class NettyHttpClient extends AbstractHttpClient
Constructor and Description |
---|
NettyHttpClient(ResourcePool<String,org.jboss.netty.channel.ChannelFuture> pool) |
Modifier and Type | Method and Description |
---|---|
<Intermediate,Final> |
go(Request request,
HttpResponseHandler<Intermediate,Final> handler,
org.joda.time.Duration requestReadTimeout)
Submit a request and process the response with the given response handler.
|
void |
start() |
void |
stop() |
HttpClient |
withReadTimeout(org.joda.time.Duration readTimeout) |
NettyHttpClient |
withTimer(org.jboss.netty.util.Timer timer) |
go
public NettyHttpClient(ResourcePool<String,org.jboss.netty.channel.ChannelFuture> pool)
public void start()
public void stop()
public HttpClient withReadTimeout(org.joda.time.Duration readTimeout)
public NettyHttpClient withTimer(org.jboss.netty.util.Timer timer)
public <Intermediate,Final> com.google.common.util.concurrent.ListenableFuture<Final> go(Request request, HttpResponseHandler<Intermediate,Final> handler, org.joda.time.Duration requestReadTimeout)
HttpClient
Note that the Request object passed in to the HttpClient *may* be mutated by the actual client. This is largely done by composed clients, but the contract is that mutation is possible. It is the caller's responsibility to pass in a copy of the Request object if they want to have an object that is not mutated.
Intermediate
- The type of the intermediate results from the handlerFinal
- The type of the final results that the returned ListenableFuture will containrequest
- Request to process, this *may* be mutated by the clienthandler
- An asynchronous response handler that will be used to process results from the http callrequestReadTimeout
- Read timeout to use for this request. Leave null to use the default readTimeout. Set to zero
to disable timeouts for this request.Copyright © 2011–2018. All rights reserved.