Skip to content
This repository has been archived by the owner on Oct 4, 2022. It is now read-only.

Refactor state management outside the overlord. #18

Merged
merged 9 commits into from
Sep 12, 2018

Conversation

paradoxengine
Copy link
Contributor

This will ease future usage of a central DB for state between an array of overlords.
It uses a local cache through the same library and general set up we have in the Minion, making it a bit easier to test parts of the Overlord.
Note that in this refactoring I pulled out the chunk-merging code away from the overlord and into the implementation of the state manager, which might - or quite likely might not - be the right thing to do.

This will ease future usage of a central DB for state between
an array of overlords.
@paradoxengine paradoxengine added this to the 0.1 milestone Sep 4, 2018
Copy link
Contributor

@n3vermind n3vermind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

}

// LocalStateManager handles state through a local time-expiring cache.
type LocalStateManager struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could move this to a separate package (say, 'state'), and name this Local. Then calling this would be state.NewLocal(), and in future also state.NewFoobar where Foobar is some form of a distributed state manager.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a good idea. One drawback though is that mappedInterest is now caught between the 2 packages (it's defined in the overlord, I was using it in state). Any suggestions on how to break this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I've moved everything into the state package :-) Let me know what you think

@paradoxengine paradoxengine merged commit dfed0ea into master Sep 12, 2018
@paradoxengine paradoxengine deleted the overlord_statemanager branch September 12, 2018 20:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants