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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user