IN - The type that will be received by this clientOUT - The type that will be sent by this clientpublic class NettyTcpClient<IN,OUT> extends TcpClient<IN,OUT>
TcpClient.channels, prefetch| Constructor and Description |
|---|
NettyTcpClient(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
java.net.InetSocketAddress connectAddress,
ClientSocketOptions options,
SslOptions sslOptions,
reactor.io.codec.Codec<reactor.io.buffer.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 NettyChannelStream<IN,OUT> |
bindChannel(java.lang.Object nativeChannel,
long prefetch)
Subclasses should implement this method and provide a
ChannelStream object. |
reactor.rx.Promise<java.lang.Boolean> |
close()
Close this client and the underlying channel.
|
reactor.rx.Promise<java.lang.Boolean> |
open()
Open a channel to the configured address and return a
Promise that will be
fulfilled with the connected Channel. |
reactor.rx.Stream<java.lang.Boolean> |
open(Reconnect reconnect)
Open a channel to the configured address and return a
reactor.rx..Stream that will be populated
by the ChannelStream every time a connection or reconnection is made. |
getConnectAddress, getOptions, getSslOptions, pipelineaddWritePublisher, completeConsumer, createAdaptiveDemandMapper, createBatchAction, createErrorConsumer, doPipeline, getDefaultCodec, getDispatcher, getEnvironment, getPrefetchSize, mergeWrite, notifyError, notifyNewChannel, notifyShutdown, routeChannel, subscribe, subscribeChannelHandlersadaptiveConsume, adaptiveConsumeOn, batchConsume, batchConsumeOn, broadcast, broadcastOn, broadcastTo, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, cache, capacity, cast, cleanSubscriptionReference, combine, concatMap, concatWith, consume, consume, consume, consume, consume, consumeLater, consumeOn, consumeOn, consumeOn, count, count, defaultIfEmpty, dematerialize, dispatchOn, dispatchOn, dispatchOn, distinct, distinct, distinctUntilChanged, distinctUntilChanged, downstreamSubscription, elapsed, elementAt, elementAtOrDefault, env, exists, fanIn, filter, filter, finallyDo, flatMap, getCapacity, getTimer, groupBy, ignoreErrors, ignoreErrors, isReactivePull, join, joinWith, keepAlive, last, lift, log, log, map, materialize, merge, mergeWith, nest, next, notify, notify, observe, observeCancel, observeComplete, observeError, observeSubscribe, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturn, onOverflowBuffer, onOverflowBuffer, onOverflowDrop, partition, partition, recover, reduce, reduce, repeat, repeat, repeatWhen, requestWhen, retry, retry, retry, retry, retryWhen, sample, sample, sample, sample, sample, sample, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, scan, scan, skip, skip, skip, skipWhile, skipWhile, sort, sort, sort, sort, split, split, startWith, startWith, startWith, subscribe, subscribeOn, subscribeOn, subscribeOn, switchMap, take, take, take, takeWhile, takeWhile, tap, throttle, throttle, timeout, timeout, timeout, timeout, timestamp, toBlockingQueue, toBlockingQueue, toList, toList, toString, when, window, window, window, window, window, window, window, window, window, window, window, zip, zipWith, zipWithpublic NettyTcpClient(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
java.net.InetSocketAddress connectAddress,
ClientSocketOptions options,
SslOptions sslOptions,
reactor.io.codec.Codec<reactor.io.buffer.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 address the client will connect tooptions - The configuration options for the client's socketsslOptions - The SSL configuration options for the client's socketcodec - The codec used to encode and decode datapublic reactor.rx.Promise<java.lang.Boolean> open()
ClientPromise that will be
fulfilled with the connected Channel.Promise that will be completed when connectedpublic reactor.rx.Stream<java.lang.Boolean> open(Reconnect reconnect)
Clientreactor.rx..Stream that will be populated
by the ChannelStream every time a connection or reconnection is made.reconnect - the reconnection strategy to use when disconnects happenpublic reactor.rx.Promise<java.lang.Boolean> close()
Clientprotected NettyChannelStream<IN,OUT> bindChannel(java.lang.Object nativeChannel, long prefetch)
PeerStreamChannelStream object.bindChannel in class PeerStream<IN,OUT,ChannelStream<IN,OUT>>