OrleansTestKit
OrleansTestKit copied to clipboard
Add method for adding PersistentState for grains using PersistentStateFacets
This is based on @enewnham's helper method in the linked issue. I've extended it to allow you to add multiple persistent states on the grain identified by StateName and StorageName.
I had to change StorageManager to allow multiple storages to be registered. I didn't change the existing interface and instead made them default the state name to Default
.
closes #55
Hi @Romanx ,
Are you planning to resolve the comments and finish the PR?
Hey @arnoldpistorius,
I'm planning to but haven't found any time. If i'm lucky I should be able to today.
Sorry for the delay in working on this. I've pushed changes and brought the original inline with main.
The major changes are now that Grain<TState>
states are keyed in the same way that orleans does which is using the FullName of the grain type. This means that some changes had to be made to the interface when looking up the state information, you either have to provide a StateName or a Grain type.
I understand that this is a breaking change but it does make it more obvious what you're looking up and where.
Hey, sorry for the long lack of movement on this PR. I brought this up to date with main and pulled in some changes from my local project that uses these extensions.
I got rid of more of the defaults and instead changed the interfaces to take the grain type so we can mimic orleans in the way the state is stored at a lower level.
There are more external facing changes than I wanted to make so this is probably a version bump in the library, not sure what the process is for your versioning, let me know if there are any other changes that you would want and I should have time to make them.
@seniorquico Gentle nudge on a review for this if you've got time!
@seniorquico +1 on the Gentle nudge
@seniorquico and @Romanx what happened with the code? It seems to be removed / reverted when support for Orleans 7 has been added, is that correct?
It does look like this ended up being removed when the the 7.0 branch was merged. I don't have time at the moment to re-apply the changes and submit a new PR so if you would like to @michel-codekapitein you're more than welcome.
I don't think the area changed much in Orleans 7 so you should be able to manually apply them quite quickly. If you do create a PR feel free to tag me and I'll take a look 👍
I just looked at this with a mind to re-apply the PR but realized that it will be take me too long to get up to speed with the internals of testkit -- @Romanx -- any chance you have time now? :)
I found a little time @oising so submitted a PR with the changes restored.
@Romanx Thank you!