Github user zentol commented on a diff in the pull request:
https://github.com/apache/flink/pull/4767#discussion_r142634073
--- Diff:
flink-runtime/src/main/java/org/apache/flink/runtime/rest/RestClient.java ---
@@ -275,4 +301,121 @@ public HttpResponseStatus getHttpResponseStatus() {
return httpResponseStatus;
}
}
+
+ public <M extends MessageHeaders<EmptyRequestBody,
WebSocketUpgradeResponseBody, U>, U extends MessageParameters, R extends
ResponseBody> CompletableFuture<WebSocket> sendWebSocketRequest(String
targetAddress, int targetPort, M messageHeaders, U messageParameters, Class<R>
messageClazz, WebSocketListener... listeners) throws IOException {
--- End diff --
I really dislike how the `WebSocketUpgradeResponseBody` is defined as the
response in the headers. Not only is this not the actual response we're getting
back (that would be R), we now also introduce an arbitrary response type, which
voids the type safety and prevents us from auto-generating proper documentation.
The MessageHeaders are very much a high-level user-facing specification,
but here we're using it for the setup of the websockets which is a pretty
relatively low-level affair.
---