Interface SseClient
- Since:
- 1.0
-
Method Summary
Modifier and TypeMethodDescriptionstatic SseClientCreate a newSseClient.static SseClientcreate(@Nullable URL url, HttpClientConfiguration configuration) Create a newSseClientwith the specified configuration.<I> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<io.micronaut.core.io.buffer.ByteBuffer<?>>> eventStream(io.micronaut.http.HttpRequest<I> request) Perform an HTTP request and receive data as a stream of SSEEventobjects as they become available without blocking.<I,B> org.reactivestreams.Publisher <io.micronaut.http.sse.Event<B>> eventStream(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<B> eventType) Perform an HTTP request and receive data as a stream of SSEEventobjects as they become available without blocking.<I,B> org.reactivestreams.Publisher <io.micronaut.http.sse.Event<B>> eventStream(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<B> eventType, io.micronaut.core.type.Argument<?> errorType) Perform an HTTP request and receive data as a stream of SSEEventobjects as they become available without blocking.default <I,B> org.reactivestreams.Publisher <io.micronaut.http.sse.Event<B>> eventStream(io.micronaut.http.HttpRequest<I> request, Class<B> eventType) Perform an HTTP request and receive data as a stream of SSEEventobjects as they become available without blocking.default <B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(String uri, io.micronaut.core.type.Argument<B> eventType) Perform an HTTP GET request and receive data as a stream of SSEEventobjects as they become available without blocking.default <B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(String uri, Class<B> eventType) Perform an HTTP GET request and receive data as a stream of SSEEventobjects as they become available without blocking.
-
Method Details
-
eventStream
<I> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<io.micronaut.core.io.buffer.ByteBuffer<?>>> eventStream(io.micronaut.http.HttpRequest<I> request) Perform an HTTP request and receive data as a stream of SSE
Eventobjects as they become available without blocking.The downstream
Subscribercan regulate demand via the subscription- Type Parameters:
I- The request body type- Parameters:
request- TheHttpRequestto execute- Returns:
- A
Publisherthat emits anEventwith the data represented as aByteBuffer
-
eventStream
<I,B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<B> eventType) Perform an HTTP request and receive data as a stream of SSE
Eventobjects as they become available without blocking.The downstream
Subscribercan regulate demand via the subscription- Type Parameters:
I- The request body typeB- The event body type- Parameters:
request- TheHttpRequestto executeeventType- The event data type- Returns:
- A
Publisherthat emits anEventwith the data represented by the eventType argument
-
eventStream
<I,B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(io.micronaut.http.HttpRequest<I> request, io.micronaut.core.type.Argument<B> eventType, io.micronaut.core.type.Argument<?> errorType) Perform an HTTP request and receive data as a stream of SSE
Eventobjects as they become available without blocking.The downstream
Subscribercan regulate demand via the subscription- Type Parameters:
I- The request body typeB- The event body type- Parameters:
request- TheHttpRequestto executeeventType- The event data typeerrorType- The type that the response body should be coerced into if the server responds with an error- Returns:
- A
Publisherthat emits anEventwith the data represented by the eventType argument - Since:
- 3.1.0
-
eventStream
default <I,B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(io.micronaut.http.HttpRequest<I> request, Class<B> eventType) Perform an HTTP request and receive data as a stream of SSE
Eventobjects as they become available without blocking.The downstream
Subscribercan regulate demand via the subscription- Type Parameters:
I- The request body typeB- The event body type- Parameters:
request- TheHttpRequestto executeeventType- The event data type- Returns:
- A
Publisherthat emits anEventwith the data represented by the eventType argument
-
eventStream
default <B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(String uri, Class<B> eventType) Perform an HTTP GET request and receive data as a stream of SSE
Eventobjects as they become available without blocking.The downstream
Subscribercan regulate demand via the subscription- Type Parameters:
B- The event body type- Parameters:
uri- The request URIeventType- The event data type- Returns:
- A
Publisherthat emits anEventwith the data represented by the eventType argument
-
eventStream
default <B> org.reactivestreams.Publisher<io.micronaut.http.sse.Event<B>> eventStream(String uri, io.micronaut.core.type.Argument<B> eventType) Perform an HTTP GET request and receive data as a stream of SSE
Eventobjects as they become available without blocking.The downstream
Subscribercan regulate demand via the subscription- Type Parameters:
B- The event body type- Parameters:
uri- The request URIeventType- The event data type- Returns:
- A
Publisherthat emits anEventwith the data represented by the eventType argument
-
create
Create a newSseClient. Note that this method should only be used outside the context of a Micronaut application. The returnedSseClientis not subject to dependency injection. The creator is responsible for closing the client to avoid leaking connections. Within a Micronaut application useInjectto inject a client instead.- Parameters:
url- The base URL- Returns:
- The client
-
create
Create a newSseClientwith the specified configuration. Note that this method should only be used outside the context of an application. Within Micronaut useInjectto inject a client instead- Parameters:
url- The base URLconfiguration- the client configuration- Returns:
- The client
- Since:
- 2.2.0
-