From 527d548743a48934465da355a110b4a71079cbba Mon Sep 17 00:00:00 2001 From: jesopo Date: Tue, 28 Aug 2018 15:32:50 +0100 Subject: Seperate .waiting_send() and throttle logic --- IRCServer.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'IRCServer.py') diff --git a/IRCServer.py b/IRCServer.py index 0908dc76..e38f664e 100644 --- a/IRCServer.py +++ b/IRCServer.py @@ -222,8 +222,10 @@ class Server(object): self.write_buffer[:512]):] self.last_send = time.monotonic() def waiting_send(self): - return bool(len(self.write_buffer)) and self.send_timeout() == 0 - def send_timeout(self): + return bool(len(self.write_buffer)) + def throttle_done(self): + return self.send_throttle_timeout() == 0 + def send_throttle_timeout(self): if self.last_send == None: return 0 timeout = (self.last_send)+0.5 -- cgit v1.3.1-10-gc9f91