local, adds three tables, the piloop journal command and the route POST /v1/campaigns/{campaign}/journal:
contribution():
Tables and migrations
A plugin keeps its tables in the home’s database. It declares them in aSchema, with an entry point in
piloop.schemas. The entry point’s name is the schema’s: the provider that has the tables, such as memory/local, or
a name of the plugin’s own. Every table that no plugin declares is core’s.
migrations/is the plugin’s own chain of Alembic revisions,0001first. piloop migrates core’s chain first, then each plugin’s, in one transaction. Themigrationstable has one row for core and for each plugin.- A table references the plugin’s own tables, or the
idof a core table. piloop refuses any other reference, or a table that another schema has, before the daemon starts. Schema.triggersholds the triggers on the plugin’s tables. Every connection creates the TEMP ones, and the plugin’s revisions create the others.- When you uninstall the plugin, its tables, rows and revision stay, and piloop does not read them.
piloop doctornames the package. When you install it again, it migrates from its own revision.
Commands
An entry point inpiloop.commands adds a command, or a group of them. Its name is the command’s, and it names a
function or a cyclopts App:
piloop imports it only when the command runs, or when a help lists it. A name that a command of piloop has is
refused.
Routes and consumers
A provider that implementscontribution() adds, while the daemon runs:
- Consumers: jobs of the daemon’s loop. A consumer runs in the next turn after a new event of a kind that it wakes
on, and when the time that it returned comes. It reads the tables, not a queue of its own. Its
Phasesays when it runs in a turn:CONFIGURE,UPKEEP,IN_FLIGHT,OBSERVEorPLAN, in that order. - A router: routes of the daemon’s server, next to the API’s. A network says who may call them.