public class SseEventSinkImpl extends Object implements javax.ws.rs.sse.SseEventSink
Modifier and Type | Field and Description |
---|---|
static String |
BUFFER_SIZE_PROPERTY |
Constructor and Description |
---|
SseEventSinkImpl(javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent> writer,
javax.ws.rs.container.AsyncResponse async,
javax.servlet.AsyncContext ctx)
Create new SseEventSink implementation with the default buffer size of 10000
SSE events.
|
SseEventSinkImpl(javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent> writer,
javax.ws.rs.container.AsyncResponse async,
javax.servlet.AsyncContext ctx,
int bufferSize)
Create new SseEventSink implementation with the configurable SSE events buffer
size.
|
Modifier and Type | Method and Description |
---|---|
void |
close() |
javax.servlet.AsyncContext |
getAsyncContext() |
boolean |
isClosed() |
CompletionStage<?> |
send(javax.ws.rs.sse.OutboundSseEvent event) |
public static final String BUFFER_SIZE_PROPERTY
public SseEventSinkImpl(javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent> writer, javax.ws.rs.container.AsyncResponse async, javax.servlet.AsyncContext ctx)
writer
- message body writerasync
- asynchronous responsectx
- asynchronous contextpublic SseEventSinkImpl(javax.ws.rs.ext.MessageBodyWriter<javax.ws.rs.sse.OutboundSseEvent> writer, javax.ws.rs.container.AsyncResponse async, javax.servlet.AsyncContext ctx, int bufferSize)
writer
- message body writerasync
- asynchronous responsectx
- asynchronous contextbufferSize
- SSE events buffer sizepublic javax.servlet.AsyncContext getAsyncContext()
public void close()
close
in interface AutoCloseable
close
in interface javax.ws.rs.sse.SseEventSink
public boolean isClosed()
isClosed
in interface javax.ws.rs.sse.SseEventSink
public CompletionStage<?> send(javax.ws.rs.sse.OutboundSseEvent event)
send
in interface javax.ws.rs.sse.SseEventSink
Apache CXF