Reputation: 1872
I need a reader-writer grain(s?) to hold some values so other parts of the system can reference them frequently and in parallel.
What I'm after is storing some system-wide config values which are accessed frequently, and subject to change, but only extremely rarely (once a month or so at most). The system should be reconfigurable without downtime. What I'm currently considering is to store the data in some database. Then it will be read at silo startup, and there will be a special callback to read the data again after it changes externally. I don't want to read the data from the database every time I need it because:
I can easily create a reader-writer locked in-memory data store, but Orleans' single-threaded execution policy doesn't allow parallel access to the grain that holds the data. I can think of the following ways to bypass this:
Suggestions?
Upvotes: 3
Views: 827
Reputation: 1872
We found a solution that doesn't require timer-based updates over on GitHub. I'll detail the solution here:
Upvotes: 2
Reputation: 2623
Have you looked at something like the Smart cache pattern ?
Perhaps using a Reentrant
grain could help as well, this will allow method calls to interleave.
I found this issue on github asking for the same.
Upvotes: 2