InMemoryFeatureStore
In-memory implementation of AbstractFeatureStore that stores features in memory.
This implementation provides thread-safe operations using a Mutex to protect concurrent access. All data is stored in memory and will be lost when the application stops.
Thread Safety: All operations are protected by a reentrant mutex mechanism to ensure thread safety. Internal suspend methods can be safely called from within locked blocks.
Use Cases:
Testing and development
Simple applications where persistence is not required
Prototyping feature flag systems
Parameters
Optional map of features to initialize the store with
Functions
Add a feature to a group.
Check if a group exists in the store.
Create or update a feature (upsert operation).
Disable all features associated with the specified group.
Enable all features associated with the specified group.
Get all group names in the store.
Read a feature from the store or throw an exception if not found.
Grant a role/permission to a feature.
Delete a feature from the store.
Create a new feature in the store.
Remove a feature from its group.
Revoke a role/permission from a feature.
Update a feature using a transformation function.