public class HandlerSubscriber<T>
extends io.netty.channel.ChannelDuplexHandler
implements org.reactivestreams.Subscriber<T>
| Constructor and Description |
|---|
HandlerSubscriber(io.netty.util.concurrent.EventExecutor executor)
Create a new handler subscriber with the default low and high watermarks.
|
HandlerSubscriber(io.netty.util.concurrent.EventExecutor executor,
long demandLowWatermark,
long demandHighWatermark)
Create a new handler subscriber.
|
| Modifier and Type | Method and Description |
|---|---|
void |
channelActive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelInactive(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelRegistered(io.netty.channel.ChannelHandlerContext ctx) |
void |
channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx) |
protected void |
complete()
Override for custom completion handling.
|
protected void |
error(Throwable error)
Override for custom error handling.
|
void |
exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause) |
void |
handlerAdded(io.netty.channel.ChannelHandlerContext ctx) |
void |
handlerRemoved(io.netty.channel.ChannelHandlerContext ctx) |
void |
onComplete() |
void |
onError(Throwable error) |
void |
onNext(T t) |
void |
onSubscribe(org.reactivestreams.Subscription subscription) |
bind, close, connect, deregister, disconnect, flush, read, writepublic HandlerSubscriber(io.netty.util.concurrent.EventExecutor executor,
long demandLowWatermark,
long demandHighWatermark)
executor - The executor to execute asynchronous events from the publisher on.demandLowWatermark - The low watermark for demand. When demand drops below this, more will be requested.demandHighWatermark - The high watermark for demand. This is the maximum that will be requested.public HandlerSubscriber(io.netty.util.concurrent.EventExecutor executor)
executor - The executor to execute asynchronous events from the publisher on.HandlerSubscriber(EventExecutor, long, long)protected void error(Throwable error)
error - The error to handle.protected void complete()
public void handlerAdded(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerAdded in interface io.netty.channel.ChannelHandlerhandlerAdded in class io.netty.channel.ChannelHandlerAdapterExceptionpublic void channelRegistered(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelRegistered in interface io.netty.channel.ChannelInboundHandlerchannelRegistered in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelWritabilityChanged(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelWritabilityChanged in interface io.netty.channel.ChannelInboundHandlerchannelWritabilityChanged in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelActive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelActive in interface io.netty.channel.ChannelInboundHandlerchannelActive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void channelInactive(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
channelInactive in interface io.netty.channel.ChannelInboundHandlerchannelInactive in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void handlerRemoved(io.netty.channel.ChannelHandlerContext ctx)
throws Exception
handlerRemoved in interface io.netty.channel.ChannelHandlerhandlerRemoved in class io.netty.channel.ChannelHandlerAdapterExceptionpublic void exceptionCaught(io.netty.channel.ChannelHandlerContext ctx,
Throwable cause)
throws Exception
exceptionCaught in interface io.netty.channel.ChannelHandlerexceptionCaught in interface io.netty.channel.ChannelInboundHandlerexceptionCaught in class io.netty.channel.ChannelInboundHandlerAdapterExceptionpublic void onSubscribe(org.reactivestreams.Subscription subscription)
onSubscribe in interface org.reactivestreams.Subscriber<T>public void onError(Throwable error)
onError in interface org.reactivestreams.Subscriber<T>public void onComplete()
onComplete in interface org.reactivestreams.Subscriber<T>Copyright © 2020. All rights reserved.