Package ai.platon.pulsar.skeleton.plugin
Interface CrawlEventMount
-
- All Implemented Interfaces:
-
ai.platon.pulsar.skeleton.plugin.PluginMount
public interface CrawlEventMount implements PluginMount
Mount point for crawl-phase event handlers.
The
PluginManagercalls configureCrawlHandlers with the active CrawlEventHandlers chain, allowing the plugin to register handlers on any crawl-phase hook:onWillLoad— before URL enters the load/browse pipeline (can reject URLs)onLoaded— after pipeline completes (results available)
class UrlFilterPlugin : CrawlEventMount { override fun configureCrawlHandlers(handlers: CrawlEventHandlers) { handlers.onWillLoad.addLast { url -> if (isBlacklisted(url.url)) null else url // reject blacklisted } } }
-
-
Method Summary
Modifier and Type Method Description abstract UnitconfigureCrawlHandlers(CrawlEventHandlers handlers)Called by PluginManagerto let this plugin register handlers on any crawl-phase event hook.-
-
Method Detail
-
configureCrawlHandlers
abstract Unit configureCrawlHandlers(CrawlEventHandlers handlers)
Called by
PluginManagerto let this plugin register handlers on any crawl-phase event hook.- Parameters:
handlers- the active crawl event handlers chain (never null at call time)
-
-
-
-