mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-12-26 20:52:45 +01:00
Twisted: Send all available ircmsgs and reduce delay between checks
All ircmsgs that takeMsg will return should be processed each time
checkIrcForMsgs is called since there may be multiple available in the
fastqueue.
Reduced the time between calls of checkIrcForMsgs so the delay between
normally queued ircmsgs stays close to the configured throttleTime.
Closes: Sf#3018148
(cherry picked from commit adc5d62bbf
)
Signed-off-by: Daniel Folkinshteyn <nanotube@users.sourceforge.net>
This commit is contained in:
parent
1ce52f01f4
commit
929859b246
@ -66,7 +66,7 @@ class SupyIrcProtocol(LineReceiver):
|
|||||||
delimiter = '\n'
|
delimiter = '\n'
|
||||||
MAX_LENGTH = 1024
|
MAX_LENGTH = 1024
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.mostRecentCall = reactor.callLater(1, self.checkIrcForMsgs)
|
self.mostRecentCall = reactor.callLater(0.1, self.checkIrcForMsgs)
|
||||||
|
|
||||||
def lineReceived(self, line):
|
def lineReceived(self, line):
|
||||||
msg = drivers.parseMsg(line)
|
msg = drivers.parseMsg(line)
|
||||||
@ -76,9 +76,10 @@ class SupyIrcProtocol(LineReceiver):
|
|||||||
def checkIrcForMsgs(self):
|
def checkIrcForMsgs(self):
|
||||||
if self.connected:
|
if self.connected:
|
||||||
msg = self.irc.takeMsg()
|
msg = self.irc.takeMsg()
|
||||||
if msg:
|
while msg:
|
||||||
self.transport.write(str(msg))
|
self.transport.write(str(msg))
|
||||||
self.mostRecentCall = reactor.callLater(1, self.checkIrcForMsgs)
|
msg = self.irc.takeMsg()
|
||||||
|
self.mostRecentCall = reactor.callLater(0.1, self.checkIrcForMsgs)
|
||||||
|
|
||||||
def connectionLost(self, r):
|
def connectionLost(self, r):
|
||||||
self.mostRecentCall.cancel()
|
self.mostRecentCall.cancel()
|
||||||
|
Loading…
Reference in New Issue
Block a user