@ChannelHandler.Sharable public class ServerSentEventEncoder extends io.netty.handler.codec.MessageToByteEncoder<ServerSentEvent>
ServerSentEvent
to a ByteBuf
Constructor and Description |
---|
ServerSentEventEncoder() |
ServerSentEventEncoder(boolean splitSseData)
Splits the SSE data on new line and create multiple "data" events if
splitSseData is true |
Modifier and Type | Method and Description |
---|---|
protected void |
encode(io.netty.channel.ChannelHandlerContext ctx,
ServerSentEvent serverSentEvent,
io.netty.buffer.ByteBuf out) |
acceptOutboundMessage, allocateBuffer, write
bind, close, connect, deregister, disconnect, flush, read
exceptionCaught, handlerAdded, handlerRemoved, isSharable
public ServerSentEventEncoder()
public ServerSentEventEncoder(boolean splitSseData)
splitSseData
is true
splitSseData
- true
if the SSE data is to be splitted on new line to create multiple "data" events.protected void encode(io.netty.channel.ChannelHandlerContext ctx, ServerSentEvent serverSentEvent, io.netty.buffer.ByteBuf out) throws java.lang.Exception
encode
in class io.netty.handler.codec.MessageToByteEncoder<ServerSentEvent>
java.lang.Exception