Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring of the pipeline processing and state transitions #99

Open
giffels opened this issue Oct 9, 2019 · 0 comments
Open

Refactoring of the pipeline processing and state transitions #99

giffels opened this issue Oct 9, 2019 · 0 comments

Comments

@giffels
Copy link
Member

giffels commented Oct 9, 2019

Currently the state transistions between internal states are defined by nested dictionaries. For example:

transition = {
ResourceStatus.Running: lambda: {
MachineStatus.NotAvailable: lambda: IntegratingState(),
MachineStatus.Available: lambda: AvailableState(),
MachineStatus.Draining: lambda: DrainingState(),
MachineStatus.Drained: lambda: DisintegrateState()
},
ResourceStatus.Booting: lambda: defaultdict(lambda: BootingState),
ResourceStatus.Deleted: lambda: defaultdict(lambda: DownState),
ResourceStatus.Stopped: lambda: defaultdict(lambda: CleanupState),
ResourceStatus.Error: lambda: defaultdict(lambda: CleanupState)
}

In addition, a pipeline of function calls is used to decided the next state of a resource. For example:

processing_pipeline = [resource_status, batchsystem_machine_status]

This representation, in particular the nested dictionaries are confusing and should be change by a different representation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant