Commits

Jason R. Coombs committed 0c7501b Merge

Merge

  • Participants
  • Parent commits 4b72050, 68f7a39
  • Tags 8.3

Comments (0)

Files changed (2)

 Changes
 -------
 
+8.3
+===
+
+* Added a ``set_keepalive`` method to the ServerConnection. Sends a periodic
+  PING message every indicated interval.
+
 8.2
 ===
 
         """
         self.send_raw = Throttler(self.send_raw, frequency)
 
+    def set_keepalive(self, interval):
+        """
+        Set a keepalive to occur every ``interval`` on this connection.
+        """
+        pinger = functools.partial(self.ping, 'keep-alive')
+        self.irclibobj.execute_every(period=interval, function=pinger)
+
+
 class Throttler(object):
     """
     Rate-limit a function (or other callable)
         time.sleep(max(0, must_wait))
         return self.func(*args, **kwargs)
 
+
 class DCCConnectionError(IRCError):
     pass