Package ratpack.core.sse.client
Interface ServerSentEventClient
-
public interface ServerSentEventClient
A client for request Server Sent Event streams.- Since:
- 1.10
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static ServerSentEventClient
of(HttpClient httpClient)
Creates a client that uses the given HTTP client.default Promise<ServerSentEventResponse>
request(URI uri)
Makes a request for an event stream to the given location.Promise<ServerSentEventResponse>
request(URI uri, Action<? super RequestSpec> action)
Makes a request for an event stream to the given location.
-
-
-
Method Detail
-
of
static ServerSentEventClient of(HttpClient httpClient)
Creates a client that uses the given HTTP client.- Parameters:
httpClient
- the HTTP client to use- Returns:
- a server sent event client
-
request
Promise<ServerSentEventResponse> request(URI uri, Action<? super RequestSpec> action)
Makes a request for an event stream to the given location.- Parameters:
uri
- the location of the event streamaction
- the request configurer- Returns:
- the response
-
request
default Promise<ServerSentEventResponse> request(URI uri)
Makes a request for an event stream to the given location.- Parameters:
uri
- the location of the event stream- Returns:
- the response
-
-