add IRCServer.clear_send_buffer() to clear queued lines
This commit is contained in:
parent
91c2ab03ba
commit
11c4d70156
2 changed files with 4 additions and 0 deletions
|
@ -19,6 +19,7 @@ class Module(ModuleManager.BaseModule):
|
|||
self.events.on("signal.interrupt").call(signum=signum)
|
||||
|
||||
for server in self.bot.servers.values():
|
||||
server.socket.clear_send_buffer()
|
||||
line = server.send_quit("Shutting down")
|
||||
server.send_enabled = False
|
||||
line.on_send(self._make_hook(server))
|
||||
|
|
|
@ -148,6 +148,9 @@ class Socket(IRCObject.Object):
|
|||
|
||||
return sent_lines
|
||||
|
||||
def clear_send_buffer(self):
|
||||
self._queued_lines.clear()
|
||||
|
||||
def waiting_send(self) -> bool:
|
||||
return bool(len(self._write_buffer)) or bool(len(self._queued_lines))
|
||||
|
||||
|
|
Loading…
Reference in a new issue