@ChannelHandler.Sharable
public class SseChannelHandler
extends io.netty.channel.SimpleChannelInboundHandler<java.lang.Object>
ServerSentEventDecoder
at a proper position in the pipeline according to the protocol. ServerSentEventDecoder
is inserted after this SseChannelHandler
ServerSentEventDecoder
is inserted as the first handler in the pipeline. This makes the
ByteBuf
at the origin to be converted to ServerSentEvent
and hence any other handler
will not look at this message unless it is really interested.
ServerSentEventDecoder
as the first handler), the ServerSentEventDecoder
will not be applied to those
messages. For this reason we also add ServerSentEventDecoder
after this handler. In cases, where the first
ServerSentEventDecoder
is applied on the incoming data, the next instance of ServerSentEventDecoder
will be redundant.Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAME |
static java.lang.String |
SSE_DECODER_HANDLER_NAME |
static java.lang.String |
SSE_DECODER_POST_INBOUND_HANDLER |
Constructor and Description |
---|
SseChannelHandler() |
Modifier and Type | Method and Description |
---|---|
protected void |
channelRead0(io.netty.channel.ChannelHandlerContext ctx,
java.lang.Object msg) |
acceptInboundMessage, channelRead
channelActive, channelInactive, channelReadComplete, channelRegistered, channelUnregistered, channelWritabilityChanged, exceptionCaught, userEventTriggered
handlerAdded, handlerRemoved, isSharable
public static final java.lang.String NAME
public static final java.lang.String SSE_DECODER_HANDLER_NAME
public static final java.lang.String SSE_DECODER_POST_INBOUND_HANDLER