Flipbed commented on a change in pull request #85:
URL: https://github.com/apache/pulsar-dotpulsar/pull/85#discussion_r685859578



##########
File path: src/DotPulsar/Abstractions/IPulsarClientBuilder.cs
##########
@@ -52,6 +52,11 @@ public interface IPulsarClientBuilder
         /// </summary>
         IPulsarClientBuilder RetryInterval(TimeSpan interval);
 
+        /// <summary>
+        /// Set a timeout for the watchdog to reconnect if no messages are 
received. The default disabled (using Timeout.InfiniteTimespan).
+        /// </summary>
+        public IPulsarClientBuilder UseWatchdog(TimeSpan timeout);

Review comment:
       I think it should be enabled by default using the default timeout of 60 
seconds. It's probably unwize to not use the watchdog. 

##########
File path: src/DotPulsar/Internal/Watchdog.cs
##########
@@ -0,0 +1,61 @@
+namespace DotPulsar.Internal
+{
+    using System;
+    using System.Collections.Generic;
+    using System.Text;
+    using System.Threading;
+
+    public class Watchdog: IDisposable
+    {
+        private CancellationTokenSource _cancellationTokenSource;
+        private readonly TimeSpan _timeout;
+        private readonly Timer _timer;
+
+        public Watchdog(TimeSpan timeout)
+        {
+            _timeout = timeout;

Review comment:
       The watchdog should probably add a few seconds (3 maybe?) to the timeout 
to compensate for any potential travel time delays between the server and 
client.




-- 
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: dev-unsubscr...@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to