Skip to content

feat: Create GlobalHookManager. - #134

Open
NeaguGeorgiana23 wants to merge 2 commits into
mainfrom
global_hook_manager
Open

feat: Create GlobalHookManager.#134
NeaguGeorgiana23 wants to merge 2 commits into
mainfrom
global_hook_manager

Conversation

@NeaguGeorgiana23

Copy link
Copy Markdown
Contributor

This PR

  • Implements GlobalHookManager as an independent, thread-safe singleton to store and manage global hooks using std::shared_mutex.
  • Decouples global hook management from OpenFeatureAPI, mirroring the design pattern established by GlobalContextManager. This allows ClientAPI to access global hooks during flag evaluation without introducing a circular dependency between :client_api and :openfeature_api in Bazel.
  • Updates OpenFeatureAPI to delegate AddHook, AddHooks, GetHooks, and Shutdown (clearing hooks) to GlobalHookManager::GetInstance().
  • Ensures nullptr hook pointers are filtered out and registration order is strictly preserved.
  • Adds comprehensive unit tests in test/global_hook_manager_test.cpp covering initial state, single/batch hook registration, order preservation, null filtering, hook clearing, and multithreaded reader/writer stress testing.

Related Issues

Fixes #133

Follow-up Tasks

  • Implement the hook execution lifecycle pipeline (before, after, error, finally) inside ClientAPI::EvaluateFlag.
  • Add e2e tests for the complete hook evaluation pipeline.

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
@NeaguGeorgiana23
NeaguGeorgiana23 requested review from a team as code owners August 26, 2026 14:33
@coderabbitai

coderabbitai Bot commented Aug 26, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: ca5754e5-c465-4ad4-bd76-6e8fbe13a4a0


Comment @coderabbitai help to get the list of available commands.

Signed-off-by: NeaguGeorgiana23 <neagugeorgiana@google.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create HookContextManager

1 participant