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:
@@ -79,6 +79,18 @@ type Filter interface {
|
||||
Groups(ctx context.Context) ([]Group, error)
|
||||
}
|
||||
|
||||
// Rebuilder asks the sitemap for a rebuild. RequestRebuild queues one
|
||||
// debounced rebuild, the same one a record event queues: a request inside
|
||||
// the debounce window joins the rebuild already queued. Another plugin
|
||||
// calls it when something its Filter reads has changed (the SEO plugin's
|
||||
// noindex paths). The sitemap plugin publishes it with
|
||||
// app.Publish[contract.Rebuilder] in its Register; a plugin that finds none
|
||||
// published (an older sitemap plugin) leaves the change to the next
|
||||
// scheduled rebuild.
|
||||
type Rebuilder interface {
|
||||
RequestRebuild(ctx context.Context) error
|
||||
}
|
||||
|
||||
// Listing is what the sitemap publishes for other plugins: its settings and
|
||||
// the listed addresses of each group. The sitemap plugin publishes it with
|
||||
// app.Publish[contract.Listing] in its Register.
|
||||
|
||||
Reference in New Issue
Block a user