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

[PR] Refactoring 4/3: In-memory handler outcomes & persistent state merges #221

Closed
kopf-archiver bot opened this issue Aug 18, 2020 · 0 comments
Closed
Labels
archive refactoring Code cleanup without new features added

Comments

@kopf-archiver
Copy link

kopf-archiver bot commented Aug 18, 2020

A pull request by nolar at 2019-11-06 14:40:04+00:00
Original URL: zalando-incubator/kopf#221
Merged by nolar at 2019-11-08 14:30:24+00:00

Code refactoring (part 4 of 3): split reactor state to handlers' outcomes and actual state persistence.

Issue : preparation for #59 #187 #142
Preceded: #209 (part 1/3), #210 (part 2/3), #211 (part 3/3).

Description

Having terminology fixed in #209 and the "state" word released for the reactor's state persistence, we now improve the state management itself.

The purpose is to separate the state persistence in the object's status stenza from the handler's outcomes. Specifically, to make it possible to keep the state of the handlers that are not resource-related — e.g. activity handlers, which are handled completely in-memory.

For this, a new entity is introduced: an outcome, which is conceptually close to asyncio/threading futures (result+exception bundled), but have handler-specific aspects: delays, temporary or permanent errors, etc.

The state persistence is then refactored to include the math of merging the existent state with the new outcomes, and persisting the new resulting state back to the objects.

The resource-specific state persistence is then moved upward in the call stack: from the generic handlers, to the resource-specific handling. The generic handlers now return the in-memory outcomes only, and persist nothing.

See the list of commit with step-by-step explanation of changes.

Types of Changes

  • Refactor/improvements

Commented by ancelotpinto at 2019-11-08 09:23:47+00:00
 

lgtm

@kopf-archiver kopf-archiver bot closed this as completed Aug 18, 2020
@kopf-archiver kopf-archiver bot changed the title [archival placeholder] [PR] Refactoring 4/3: In-memory handler outcomes & persistent state merges Aug 19, 2020
@kopf-archiver kopf-archiver bot added the refactoring Code cleanup without new features added label Aug 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
archive refactoring Code cleanup without new features added
Projects
None yet
Development

No branches or pull requests

0 participants