feat(decisioning): add registry observer removal#764
Open
sangilish wants to merge 1 commit into
Open
Conversation
Author
|
This is ready for review now. CI is green, and I kept the change scoped to #696: observer removal, thread-safe add/remove, and snapshot notification semantics. |
Contributor
|
Acknowledged — noted that CI is green and scope is contained to the observer lifecycle items from #696. Ready for human review. Generated by Claude Code |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Refs #696.
This adds lifecycle management for
PgBuyerAgentRegistrymutation observers. Observers can now be removed explicitly, and the observer registry is protected by a lock so add/remove operations do not race with mutation notification setup.What changed
remove_mutation_observer(observer) -> bool.threading.Lock.Testing
uv run ruff check src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.pyuv run mypy src/adcp/decisioning/pg/buyer_agent_registry.pyADCP_PG_TEST_URL=postgresql://postgres:[email protected]:55432/postgres uv run python -m pytest tests/conformance/decisioning/test_pg_buyer_agent_registry.py -qNote:
uv run mypy src/adcp/decisioning/pg/buyer_agent_registry.py tests/conformance/decisioning/test_pg_buyer_agent_registry.pycurrently fails on the existingpytest.importorskip("psycopg_pool")typing pattern in the conformance test file, unrelated to this observer lifecycle change.