Descriptionuniter: lifecycle handling
This remains WIP just for the moment, largely because it lacks tests (ha!).
Things to note and perhaps comment on at this stage:
* The modeStarting type is, I *think*, a Good Thing, because it allows me to
focus on smaller parts of the problem at a time. I believe it will start
to really pull its weight when I add relations; unless you feel there's
something fundamentally wrong with the concept/approach, please be
indulgent of its existence for a CL or two :).
* Man, lifecycle handling is a lot of code. This is particularly noticeable
in ModeHookError and ModeConflicted, which now share enough lifecycle and
watch manipulation logic that I'm very tempted to carve out a parametrized
modeAwaitResolved to keep it in. I'm really not sure whether this is
wantonly premature abstraction or sensible factoring of fiddly logic into
one place only, but I kinda still lean towards the former; this would most
probably change if we got *another* distinct error mode.
...but, really, anything that springs to mind is fair game; absent comments,
I expect to propose something pretty close to this at some stage tomorrow.
https://code.launchpad.net/~fwereade/juju-core/uniter-unit-lifecycle/+merge/126558
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 1
Patch Set 2 : uniter: lifecycle handling #Patch Set 3 : uniter: lifecycle handling #
MessagesTotal messages: 2
|