Skip to content

Commit dcd0541

Browse files
committed
feat: expose shared context services
1 parent 82d6bcf commit dcd0541

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

include/aniparse/ClientContext.hpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -472,6 +472,21 @@ class RequestorContext {
472472
*/
473473
std::shared_ptr<const ParserConfig> config() const;
474474

475+
/**
476+
* @brief Return this context's shared runtime services.
477+
*
478+
* The returned owner keeps the HTTP client, resource cache, and volatile catalog
479+
* holders alive. Hosts that construct a @ref CatalogManager for the same parser
480+
* session pass this handle to it, so a successful catalog apply updates the
481+
* mirrors and selectors observed by contexts derived from this one.
482+
* @return The immutable shared-services handle used by this context.
483+
* @note The @ref ServiceState object's holder members are intentionally mutable
484+
* synchronization points; callers must not replace the service bundle.
485+
*/
486+
[[nodiscard]] std::shared_ptr<const ServiceState> services() const noexcept {
487+
return services_;
488+
}
489+
475490
/**
476491
* @brief Shared cache of compiled parser resources (CSS selector sets,
477492
* regexes, ...), keyed by resource-set type.
@@ -636,4 +651,4 @@ class RequestorContext {
636651
/// services carry no mirror holder (every parser falls back to its built-ins).
637652
std::shared_ptr<const MirrorSource> mirror_snapshot_;
638653
};
639-
} // namespace aniparse
654+
} // namespace aniparse

0 commit comments

Comments
 (0)