Package ratpack.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 ratpack.exec.Promise<ServerSentEventResponse>
request(java.net.URI uri)
Makes a request for an event stream to the given location.ratpack.exec.Promise<ServerSentEventResponse>
request(java.net.URI uri, ratpack.func.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
ratpack.exec.Promise<ServerSentEventResponse> request(java.net.URI uri, ratpack.func.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 ratpack.exec.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
-
-