类 ReactorNettyClientRequestFactory
java.lang.Object
cn.taketoday.http.client.ReactorNettyClientRequestFactory
- 所有已实现的接口:
ClientHttpRequestFactory
Reactor-Netty implementation of
ClientHttpRequestFactory.- 从以下版本开始:
- 4.0
- 作者:
- Arjen Poutsma, Harry Yang
-
字段概要
字段 -
构造器概要
构造器构造器说明Create a new instance of theReactorNettyClientRequestFactorywith a defaultHttpClientthat has compression enabled.ReactorNettyClientRequestFactory(reactor.netty.http.client.HttpClient httpClient) Create a new instance of theReactorNettyClientRequestFactorybased on the givenHttpClient. -
方法概要
修饰符和类型方法说明createRequest(URI uri, HttpMethod httpMethod) Create a newClientHttpRequestfor the specified URI and HTTP method.voidsetConnectTimeout(int connectTimeout) Set the underlying connect timeout in milliseconds.voidsetConnectTimeout(Duration connectTimeout) Set the underlying connect timeout in milliseconds.voidsetExchangeTimeout(long exchangeTimeout) Set the timeout for the HTTP exchange in milliseconds.voidsetExchangeTimeout(Duration exchangeTimeout) Set the timeout for the HTTP exchange.voidsetReadTimeout(long readTimeout) Set the underlying read timeout in milliseconds.voidsetReadTimeout(Duration readTimeout) Set the underlying read timeout asDuration.
-
字段详细资料
-
httpClient
private final reactor.netty.http.client.HttpClient httpClient -
exchangeTimeout
-
readTimeout
-
-
构造器详细资料
-
ReactorNettyClientRequestFactory
public ReactorNettyClientRequestFactory()Create a new instance of theReactorNettyClientRequestFactorywith a defaultHttpClientthat has compression enabled. -
ReactorNettyClientRequestFactory
public ReactorNettyClientRequestFactory(reactor.netty.http.client.HttpClient httpClient) Create a new instance of theReactorNettyClientRequestFactorybased on the givenHttpClient.- 参数:
httpClient- the client to base on
-
-
方法详细资料
-
setConnectTimeout
public void setConnectTimeout(int connectTimeout) Set the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout.Default is 30 seconds.
- 另请参阅:
-
Transport.option(ChannelOption, Object)ChannelOption.CONNECT_TIMEOUT_MILLIS
-
setConnectTimeout
Set the underlying connect timeout in milliseconds. A value of 0 specifies an infinite timeout.Default is 30 seconds.
- 另请参阅:
-
Transport.option(ChannelOption, Object)ChannelOption.CONNECT_TIMEOUT_MILLIS
-
setReadTimeout
public void setReadTimeout(long readTimeout) Set the underlying read timeout in milliseconds.Default is 10 seconds.
-
setReadTimeout
Set the underlying read timeout asDuration.Default is 10 seconds.
-
setExchangeTimeout
public void setExchangeTimeout(long exchangeTimeout) Set the timeout for the HTTP exchange in milliseconds.Default is 30 seconds.
-
setExchangeTimeout
Set the timeout for the HTTP exchange.Default is 30 seconds.
-
createRequest
从接口复制的说明:ClientHttpRequestFactoryCreate a newClientHttpRequestfor the specified URI and HTTP method.The returned request can be written to, and then executed by calling
ClientHttpRequest.execute().- 指定者:
createRequest在接口中ClientHttpRequestFactory- 参数:
uri- the URI to create a request forhttpMethod- the HTTP method to execute- 返回:
- the created request
- 抛出:
IOException- in case of I/O errors
-