Class SseEventSourceImpl.SourceBuilder
java.lang.Object
jakarta.ws.rs.sse.SseEventSource.Builder
org.jboss.resteasy.plugins.providers.sse.client.SseEventSourceImpl.SourceBuilder
- Enclosing class:
- SseEventSourceImpl
-
Field Summary
Fields inherited from class jakarta.ws.rs.sse.SseEventSource.Builder
JAXRS_DEFAULT_SSE_BUILDER_PROPERTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionalwaysReconnect(boolean alwaysReconnect) build()Build new SSE event source pointing at a SSE streamingweb target.executor(ScheduledExecutorService executor) reconnectingEvery(long delay, TimeUnit unit) Set the initial reconnect delay to be used by the event source.Set the SSE streaming endpoint.
-
Constructor Details
-
SourceBuilder
public SourceBuilder()
-
-
Method Details
-
named
-
build
Description copied from class:SseEventSource.BuilderBuild new SSE event source pointing at a SSE streamingweb target.The returned event source is ready, but not
connectedto the SSE endpoint. It is expected that you will manually invoke itsSseEventSource.open()method once you are ready to start receiving SSE events. In case you want to build an event source instance that is already connected to the SSE endpoint, use the event source builderSseEventSource.open()method instead.Once the event source is open, the incoming events are processed by the event source in an asynchronous task that runs in an internal single-threaded
scheduled executor service.- Specified by:
buildin classSseEventSource.Builder- Returns:
- new event source instance, ready to be connected to the SSE endpoint.
- See Also:
-
target
Description copied from class:SseEventSource.BuilderSet the SSE streaming endpoint.- Specified by:
targetin classSseEventSource.Builder- Parameters:
target- SSE streaming endpoint. Must not benull.- Returns:
- updated event source builder instance.
-
reconnectingEvery
Description copied from class:SseEventSource.BuilderSet the initial reconnect delay to be used by the event source.Note that this value may be later overridden by the SSE endpoint using either a
retrySSE event field orHTTP 503 + "Retry-After"mechanism as described in theSseEventSourcejavadoc.- Specified by:
reconnectingEveryin classSseEventSource.Builder- Parameters:
delay- the default time to wait before attempting to recover from a connection loss.unit- time unit of the reconnect delay parameter.- Returns:
- updated event source builder instance.
-
executor
-
alwaysReconnect
-