You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This complements the existing handlers for creation/update/deletion cases, and is injected into the handling cycle when one of the mentioned cases is detected (and handled normally), but strictly when the operator has started/restarted, and found that the object existed beforehand.
Which implies that if the object was created during the operator downtime, both @kopf.on.createAND@kopf.on.resume handlers will be called. Similarly, of the object was changed during the operator downtime, both @kopf.on.updateAND@kopf.on.resume will be called (and both will get a diff of the object).
BUT: See #103 for the de-duplication of the same function if it is registered for few causes.
This "double-cause" patten becomes possible to start a background job for permanent object monitoring (the function will be called only once when the object appears: either while the operator is running and it is created, or when the operator starts and a new unhandled object is found, or when the operator starts and an existing handled object is found):
Difference from #96: Unlike a solution in #96, where the resuming handler is triggered when the object is neither created, nor updated, nor deleted, but noticed to exist, in this PR, the resume handler is called event if update/creation/deletion detected, as part of the relevant handling cycle (i.e. as one of the handlers on the list).
As a side-note: I could not decide between "resume" and "recall" for proper naming. It is "resume", as it resumes some thread that was previously running in a now-dead operator. It is "recall", as it kind of "recalls" (remembers) the object: "ah, there is also such a thing with uid 123, which is not changed!". The naming can be changed before merged.
Types of Changes
New feature (non-breaking change which adds functionality)
Refactor/improvements
Documentation / non-code
Review
Tests
Documentation
Commented by samurang87 at 2019-06-12 15:36:18+00:00
I prefer "resume" :)
The text was updated successfully, but these errors were encountered:
Description
Add the handlers for "resuming" (recalling? remembering?) an object in the operator:
This complements the existing handlers for creation/update/deletion cases, and is injected into the handling cycle when one of the mentioned cases is detected (and handled normally), but strictly when the operator has started/restarted, and found that the object existed beforehand.
Which implies that if the object was created during the operator downtime, both
@kopf.on.create
AND@kopf.on.resume
handlers will be called. Similarly, of the object was changed during the operator downtime, both@kopf.on.update
AND@kopf.on.resume
will be called (and both will get a diff of the object).BUT: See #103 for the de-duplication of the same function if it is registered for few causes.
This "double-cause" patten becomes possible to start a background job for permanent object monitoring (the function will be called only once when the object appears: either while the operator is running and it is created, or when the operator starts and a new unhandled object is found, or when the operator starts and an existing handled object is found):
Difference from #96: Unlike a solution in #96, where the resuming handler is triggered when the object is neither created, nor updated, nor deleted, but noticed to exist, in this PR, the resume handler is called event if update/creation/deletion detected, as part of the relevant handling cycle (i.e. as one of the handlers on the list).
As a side-note: I could not decide between "resume" and "recall" for proper naming. It is "resume", as it resumes some thread that was previously running in a now-dead operator. It is "recall", as it kind of "recalls" (remembers) the object: "ah, there is also such a thing with uid 123, which is not changed!". The naming can be changed before merged.
Types of Changes
Review
I prefer "resume" :)
The text was updated successfully, but these errors were encountered: