mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Converted Irc.fastqueue to a fix.queue
This commit is contained in:
parent
5ef1d3eaaa
commit
818f01e206
@ -280,7 +280,7 @@ class Irc(object):
|
||||
self._nickmods = copy.copy(conf.nickmods)
|
||||
self.state = IrcState()
|
||||
self.queue = IrcMsgQueue()
|
||||
self.fastqueue = []
|
||||
self.fastqueue = queue()
|
||||
self.lastping = time.time()
|
||||
self.lastTake = 0
|
||||
self.driver = None # The driver should set this later.
|
||||
@ -291,7 +291,7 @@ class Irc(object):
|
||||
self._nickmods = copy.copy(conf.nickmods)
|
||||
self.state.reset()
|
||||
self.queue.reset()
|
||||
self.fastqueue = []
|
||||
self.fastqueue = queue()
|
||||
self.queue.enqueueMsg(ircmsgs.user(self.user, self.ident))
|
||||
self.queue.enqueueMsg(ircmsgs.nick(self.nick))
|
||||
for callback in self.callbacks:
|
||||
@ -316,13 +316,13 @@ class Irc(object):
|
||||
self.queue.enqueueMsg(msg)
|
||||
|
||||
def sendMsg(self, msg):
|
||||
self.fastqueue.append(msg)
|
||||
self.fastqueue.enqueue(msg)
|
||||
|
||||
def takeMsg(self):
|
||||
now = time.time()
|
||||
msg = None
|
||||
if self.fastqueue:
|
||||
msg = self.fastqueue.pop(0)
|
||||
msg = self.fastqueue.dequeue()
|
||||
elif not self.queue.empty():
|
||||
if now - self.lastTake <= conf.throttleTime:
|
||||
debug.debugMsg('Irc.takeMsg throttling.', 'verbose')
|
||||
|
Loading…
Reference in New Issue
Block a user