Sequence of relation hooks?
gustavo.niemeyer at canonical.com
Mon Nov 14 18:26:19 UTC 2011
(... good info ...)
> You *can* assume that joined will always happen at least once before
> changed/departed, and that changed will happen at least once no matter
> if a change has happened on the other side or not.
Nice description, thanks Clint.
There's two more useful guarantees worth mentioning: all relation
changes performed within a hook will be observed simultaneously, and
the relation data for a given unit will not change while a hook is
In other words, if you do this within a hook:
These two values are guaranteed to be seen together.
Conversely, if you do this:
The two values are guaranteed to be related (assuming they were set in
the same hook execution as per above).
This is the kind of software magic that is good: the semantics
disappear because they're obviously what one would expect.
-- I'm not absolutely sure of anything.
More information about the Juju