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



##########
File path: 
statefun-flink/statefun-flink-core/src/test/resources/module-v2_0/module.yaml
##########
@@ -37,6 +37,10 @@ module:
               - name: seen_count
                 expireAfter: 60000millisecond
                 expireMode: after-invoke
+            timeout: 2minutes
+            connectTimeout: 20seconds
+            readTimeout: 1second

Review comment:
       Can the example say 10second on the read timeout?
   The reason is that the examples are usually copy-pasted.

##########
File path: 
statefun-flink/statefun-flink-core/src/main/java/org/apache/flink/statefun/flink/core/httpfn/HttpFunctionSpec.java
##########
@@ -111,14 +138,36 @@ public Builder withMaxRequestDuration(Duration duration) {
       return this;
     }
 
+    public Builder withConnectTimeoutDuration(Duration duration) {
+      this.connectTimeout = Objects.requireNonNull(duration);
+      return this;
+    }
+
+    public Builder withReadTimeoutDuration(Duration duration) {
+      this.readTimeout = Objects.requireNonNull(duration);
+      return this;
+    }
+
+    public Builder withWriteTimeoutDuration(Duration duration) {
+      this.writeTimeout = Objects.requireNonNull(duration);
+      return this;
+    }
+
     public Builder withMaxNumBatchRequests(int maxNumBatchRequests) {
       this.maxNumBatchRequests = maxNumBatchRequests;
       return this;
     }
 
     public HttpFunctionSpec build() {
       return new HttpFunctionSpec(
-          functionType, endpoint, states, maxRequestDuration, 
maxNumBatchRequests);
+          functionType,

Review comment:
       I think that somewhere we should validate the timeouts that they make 
sense.
   For example: all the durations are non zero, and the sum of read write and 
connect is <= call timeout.
   




----------------------------------------------------------------
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:
us...@infra.apache.org


Reply via email to