Skip to content

feat: Use a ReadOnlyStore for returning policy data#89

Merged
joachimvh merged 1 commit into
mainfrom
readonly-store
May 26, 2026
Merged

feat: Use a ReadOnlyStore for returning policy data#89
joachimvh merged 1 commit into
mainfrom
readonly-store

Conversation

@joachimvh
Copy link
Copy Markdown
Contributor

@joachimvh joachimvh commented May 12, 2026

This prevents unnecessarily copying all rules when trying to read data.

A new Store was created every time data was read, to prevent the in-memory store to be modified outside of the rules storage class, but this results in copying all policies every time data is read which is quite inefficient. This PR resolves this by introducing a new ReadOnlyStore, which retains all functions of an N3 Store that do not modify the Store in place.

Some casts were done in the BaseController to make this work, which are not ideal but that entire class is not ideal in general anyway.

This prevents unnecessarily copying all rules when trying to read data
@joachimvh joachimvh merged commit 9b08f27 into main May 26, 2026
6 checks passed
@joachimvh joachimvh deleted the readonly-store branch May 26, 2026 08:02
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.

1 participant