Replace the flawed cnsr_thrd_size threshold with cnsr_active, which
tracks the number of consumers currently executing a task. A new
consumer thread is now spawned the moment the queue is non-empty and
all existing consumers are busy, enabling true parallel execution of
slow and fast commands. The pool is capped at os.cpu_count() threads.
- bot.py: replace cnsr_thrd_size with cnsr_active + cnsr_lock + cnsr_max
- consumer.py: increment/decrement cnsr_active around stm.run(), remove
itself from cnsr_thrd under the lock, mark thread as daemon
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Silently ignore KeyError when unregistering an already-removed FD from
the poll loop (servers can queue multiple close events). Also include
the exception message when a server connection fails at startup.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Switch the IRC server implementation from the custom socket-based parser
to the irc Python library (SingleServerIRCBot), gaining automatic
exponential-backoff reconnection, built-in PING/PONG handling, and
nick-collision recovery for free.
- Add IRCLib server (server/IRCLib.py) extending ThreadedServer:
_IRCBotAdapter wraps SingleServerIRCBot with a threading.Event stop
flag so shutdown is clean and on_disconnect skips reconnect when
stopping. subparse() is implemented directly for alias/grep/rnd/cat.
- Add IRCLib printer (message/printer/IRCLib.py) calling
connection.privmsg() directly instead of building raw PRIVMSG strings.
- Update factory to use IRCLib for irc:// and ircs://; SSL is now
passed as a connect_factory kwarg rather than post-hoc socket wrapping.
- Add irc to requirements.txt.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Implement Matrix protocol support with MatrixServer (ThreadedServer subclass),
a Matrix message printer, factory URI parsing for matrix:// schemes, and
matrix-nio[e2e] dependency.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>