Package ratpack.sse.client
Interface ServerSentEventClient
-
public interface ServerSentEventClientA 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 ServerSentEventClientof(HttpClient httpClient)Creates a client that uses the given HTTP client.default Promise<ServerSentEventResponse>request(java.net.URI uri)Makes a request for an event stream to the given location.Promise<ServerSentEventResponse>request(java.net.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(java.net.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(java.net.URI uri)
Makes a request for an event stream to the given location.- Parameters:
uri- the location of the event stream- Returns:
- the response
-
-