igalshilman commented on a change in pull request #110:
URL: https://github.com/apache/flink-statefun/pull/110#discussion_r426778167



##########
File path: 
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionProvider.java
##########
@@ -41,12 +48,56 @@ public RequestReplyFunction functionOfType(FunctionType 
type) {
     if (spec == null) {
       throw new IllegalArgumentException("Unsupported type " + type);
     }
+    return new RequestReplyFunction(
+        spec.states(), spec.maxNumBatchRequests(), buildHttpClient(spec));
+  }
+
+  private RequestReplyClient buildHttpClient(HttpFunctionSpec spec) {
+    // We need to build a UDS HTTP client
+    if (spec.isUnixDomainSocket()) {
+
+      // We need to split the path in order to get the sock file and the path 
after the sock file
+      Map.Entry<String, String> splittedFilePathAndEndpoint =
+          splitFilePathAndEndpointForUDS(spec.endpoint());
+
+      OkHttpClient specificClient =
+          sharedClient
+              .newBuilder()
+              .socketFactory(
+                  new 
AFUNIXSocketFactory.FactoryArg(splittedFilePathAndEndpoint.getKey()))

Review comment:
       In that case I can see two options:
   * try out jnrsockets as provided in the original example.
   * provide a new RequestReplyClient that is specialized for Unix domain 
socket, and backed by something else than okhttp.
   




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to