You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Basic interface between bot and reactor
Reactor plugging and unplugging
Command registering and unregistering (incl. automatic unregister when reactor unplugs)
Broadcast command events to corresponding reactors
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
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.The text was updated successfully, but these errors were encountered: