IN
- The type that will be received by this clientOUT
- The type that will be sent by this clientpublic class NettyHttpClient<IN,OUT> extends HttpClient<IN,OUT>
TcpClient
.PING
started
Constructor and Description |
---|
NettyHttpClient(Environment env,
Dispatcher dispatcher,
Supplier<InetSocketAddress> connectAddress,
ClientSocketOptions options,
SslOptions sslOptions,
Codec<Buffer,IN,OUT> codec)
Creates a new NettyTcpClient that will use the given
env for configuration and the given reactor to
send events. |
Modifier and Type | Method and Description |
---|---|
protected void |
bindChannel(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler,
Object nativeChannel) |
protected Promise<Void> |
doShutdown() |
protected Promise<Void> |
doStart(ReactorChannelHandler<IN,OUT,HttpChannel<IN,OUT>> handler) |
protected Stream<Tuple2<InetSocketAddress,Integer>> |
doStart(ReactorChannelHandler<IN,OUT,HttpChannel<IN,OUT>> handler,
Reconnect reconnect) |
Promise<? extends HttpChannel<IN,OUT>> |
request(Method method,
String url,
ReactorChannelHandler<IN,OUT,HttpChannel<IN,OUT>> handler)
Use the passed HTTP method to send to the given URL.
|
delete, delete, get, get, post, put, ws, ws
start
getDefaultCodec, getDefaultDispatcher, getDefaultEnvironment, getDefaultPrefetchSize, shutdown, start
public NettyHttpClient(Environment env, Dispatcher dispatcher, Supplier<InetSocketAddress> connectAddress, ClientSocketOptions options, SslOptions sslOptions, Codec<Buffer,IN,OUT> codec)
env
for configuration and the given reactor
to
send events. The number of IO threads used by the client is configured by the environment's reactor.tcp.ioThreadCount
property. In its absence the number of IO threads will be equal to the number of available processors
. The client will connect to the given connectAddress
, configuring its socket using the given opts
. The given codec
will be used for
encoding and decoding of data.env
- The configuration environmentdispatcher
- The dispatcher used to send eventsconnectAddress
- The root host and port to connect relatively from in http handlersoptions
- The configuration options for the client's socketsslOptions
- The SSL configuration options for the client's socketcodec
- The codec used to encode and decode dataprotected Promise<Void> doStart(ReactorChannelHandler<IN,OUT,HttpChannel<IN,OUT>> handler)
doStart
in class ReactorPeer<IN,OUT,HttpChannel<IN,OUT>>
protected Stream<Tuple2<InetSocketAddress,Integer>> doStart(ReactorChannelHandler<IN,OUT,HttpChannel<IN,OUT>> handler, Reconnect reconnect)
doStart
in class ReactorClient<IN,OUT,HttpChannel<IN,OUT>>
public Promise<? extends HttpChannel<IN,OUT>> request(Method method, String url, ReactorChannelHandler<IN,OUT,HttpChannel<IN,OUT>> handler)
HttpClient
request
in class HttpClient<IN,OUT>
method
- the HTTP method to sendurl
- the target remote URLhandler
- the ReactorChannelHandler
to invoke on open channelPromise
of the HttpChannel
ready to consume for responseprotected final Promise<Void> doShutdown()
doShutdown
in class ReactorPeer<IN,OUT,HttpChannel<IN,OUT>>
protected void bindChannel(ReactorChannelHandler<IN,OUT,ChannelStream<IN,OUT>> handler, Object nativeChannel)
Copyright © 2016. All rights reserved.