twitter_ebooks 3.0
The third major release is mostly about making the library quieter, sturdier, and easier to run beside other work.
Version 3.0 of twitter_ebooks is out. Most of the work went into the parts you do not see on the timeline: how models are stored, how bots start, and how a small program behaves when it is left alone for a few weeks.
The short version is that bots should now use less memory, start faster, and fail less dramatically. The long version is below.
What changed
| Area | Change |
|---|---|
| Models | Storage and memory use dropped by roughly four fifths. A model that used to demand attention can now sit in the background. |
| Runtime | Bots run in their own threads instead of relying on an event loop. Startup happens in parallel, so a group of bots no longer arrives one by one. |
| Process control | The start command keeps a bot alive after an unexpected exception instead of letting the whole process exit. |
| Access | A new auth command creates access tokens, which makes it easier to run several bots from one machine. |
| Console | A console command opens an interpreter with the bots already loaded, so you can inspect them without restarting anything. |
| Replies | Replies are lightly rate limited, and a mention chain drops accounts that are no longer taking part. |
| Confidence | The test suite grew. The library is easier to change without surprising the people who depend on it. |
Why stop at a major release
I did not expect this library to become something other people relied on. It began as a way to make a few strange accounts, and it slowly turned into a small piece of infrastructure. Once that happened, the responsible move was to make it behave itself rather than keep adding features.
This is intended to be the last major version. Existing bots should keep working, and the changes are mostly about the environment around the model rather than the model itself.
A bot is a program that pretends to be a voice. The least interesting part is the pretending. The most interesting part is everything that keeps it running.
If you are running a bot, the upgrade path is short: install the new gem, regenerate tokens if you need more than one account, and start the process with the new command. If you are reading the source, the runtime is now a better place to begin than the text generation code.