triarc pre-1.0.0 is a monolithic codebase; there, Bot is inherited into subclasses, and commands are supplied thereby.
For 1.0.0, I'd rather Bot be able to function standalone, whereas a separate class, Reactor, would interact with it, registering commands and handling them, either in the same process or over RPC. This would effectively allow triarc to run standalone and without any code tailored for it specifically, with python -m triarc.bot.
If desired, a RPC listen port could be opened on which reactors could remotely plug. Alternatively, let the header of a triarc configuration file specify a reactor module.
User stories
- A triarc configuration loads a reactor module which imports
cobe and responds to messages by passing them as queries through it. This reactor tuns in the same Python process as the bot. The reactor plugging and unplugging is almost entirely transparent to the user.
- A triarc configuration specifies a network address in localhost (or behind an Unix socket) instead, which points to a running reactor which is, in turn, the one using COBE. This means it can stay running even if the bot restarts.
- A reactor interacts with a SQLite database. Multiple bots can plug themselves to it in order to talk to the reactor and use its functionality, which in turn accesses the data thread-safely.
triarc pre-1.0.0 is a monolithic codebase; there, Bot is inherited into subclasses, and commands are supplied thereby.
For 1.0.0, I'd rather Bot be able to function standalone, whereas a separate class, Reactor, would interact with it, registering commands and handling them, either in the same process or over RPC. This would effectively allow triarc to run standalone and without any code tailored for it specifically, with
python -m triarc.bot.If desired, a RPC listen port could be opened on which reactors could remotely plug. Alternatively, let the header of a triarc configuration file specify a reactor module.
User stories
cobeand responds to messages by passing them as queries through it. This reactor tuns in the same Python process as the bot. The reactor plugging and unplugging is almost entirely transparent to the user.