Skip to content

Conversation

@Khudoyshukur
Copy link

#85

When you create multiple stores pointing to the same file, those stores will not know about the updates from each other and can cause stores to be out of sync.

I am thinking that we can use Factory pattern here.
When creating the instances of KStore, we check first if any instance exists for the provided codec. If yes, we can use the existing instance, otherwise we create a new instance and store it in a map.

@xxfast
Copy link
Owner

xxfast commented Jul 1, 2025

Hi! Thanks for the PR 🙏

How would this work across multiple processes though? 🤔

@Khudoyshukur
Copy link
Author

@xxfast

Yes, in multi-process environment, there will be problem with multiple instances being created for each process.
I will look for ways to observe the actual file changes then, but I am not sure that we have required APIs in all platforms.

@xxfast
Copy link
Owner

xxfast commented Jul 2, 2025

@Khudoyshukur I found out about android's file observer api that could potentially help here

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.

2 participants