GumpacG commented on code in PR #3466:
URL: https://github.com/apache/tinkerpop/pull/3466#discussion_r3463331762


##########
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/ReadTimeoutHandler.java:
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.tinkerpop.gremlin.driver.handler;
+
+import io.netty.channel.ChannelDuplexHandler;
+import io.netty.channel.ChannelHandlerContext;
+import io.netty.channel.ChannelPromise;
+import io.netty.handler.codec.http.LastHttpContent;
+import io.netty.handler.timeout.ReadTimeoutException;
+import io.netty.util.concurrent.ScheduledFuture;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.concurrent.TimeUnit;
+
+/**
+ * Bounds the idle time between inbound response chunks on a per-request 
basis. The timeout is <em>armed</em> when a
+ * request is written and rescheduled on every inbound read; it is 
<em>disarmed</em> once the last chunk of the
+ * response arrives. This differs from a static {@link 
io.netty.handler.timeout.ReadTimeoutHandler} so that it never
+ * fires while a pooled connection sits idle between requests (which is the 
concern of the idle-pool-close handler).
+ * <p>
+ * When the timeout elapses while awaiting a response a {@link 
ReadTimeoutException} is fired up the pipeline and the
+ * channel is closed.
+ */
+public class ReadTimeoutHandler extends ChannelDuplexHandler {

Review Comment:
   I've split the responsibilities of `idleTimeout` and `readTimeout` so that 
there is no overlap. In flight requests is now out of `idleTimeout`'s scope



-- 
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.

To unsubscribe, e-mail: [email protected]

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

Reply via email to