feat: contract.Rebuilder asks for a debounced rebuild

The sitemap publishes classes.Listing as contract.Rebuilder too, so a
plugin whose Filter reads data of its own can queue the debounced rebuild
a record event queues when that data changes.
This commit is contained in:
Jakub Zych
2026-11-04 22:39:14 +01:00
parent 1048c01fd9
commit 6b67ab759b
5 changed files with 59 additions and 5 deletions

View File

@@ -48,11 +48,14 @@ func (p *Plugin) ID() string { return "golem15.sitemap" }
// from a named plugin, and a Filter through the service registry.
func (p *Plugin) Requires() []string { return nil }
// Register publishes the sitemap's contract.Listing for other plugins
// (D-95).
// Register publishes the sitemap's contract.Listing and contract.Rebuilder
// for other plugins (D-95).
func (p *Plugin) Register(app *backpack.App) error {
p.app = app
return app.Publish[contract.Listing](classes.Listing{App: app})
if err := app.Publish[contract.Listing](classes.Listing{App: app}); err != nil {
return err
}
return app.Publish[contract.Rebuilder](classes.Listing{App: app})
}
// Boot keeps the booted application for the routes, jobs and commands and