325.2.3
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
325.2.2
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
325.2.1
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
325
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
324
|
|
|
Roger Peppe |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
323
|
|
|
Dave Cheney |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
322
|
|
|
Gustavo Niemeyer |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
321
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
320
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
319
|
|
|
Gustavo Niemeyer |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
318
|
|
|
Gustavo Niemeyer |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
317
|
|
|
Dave Cheney |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
316
|
|
|
Gustavo Niemeyer |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
315
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
314
|
|
|
Roger Peppe |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
313
|
|
|
Frank Mueller |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
312
|
|
|
Roger Peppe |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
311
|
|
add relationUnitsWatcher
...which expresses changes to a relation from a given unit's perspective, in terms that I believe will be helpful for the unit agent.
In particular, the main event type produced has Changed and Departed fields, under the rationale that the UA will itself be keeping track of membership as it does in the python version; and that therefore it is actually more helpful to expect it to pay attention only to -changed and -departed events, and to automatically run -joined hooks *before* running -changed hooks in response to unrecognised units (rather than spearately tracking all 3 kinds of event, and *also* inserting -changed events immediately after -joineds, as is currently done in the python).
The intent is to keep this type internal, and use it only within a (tentatively-named) RelationUnit type, which (1) exposes the relationUnitsWatcher's Changes channel and (2) maintains a Pinger signalling its own presence in the relation; I'm expecting it to look something like:
func (*Unit) Join(*Relation) (*RelationUnit, error)
func (*RelationUnit) Changes() <-chan RelationUnitsChange func (*RelationUnit) Depart() error func (*RelationUnit) Abscond() error
...in which Abscond seems to me to be the best available term for "depart quietly, abandoning rather than deleting the presence node, in the hope that departure will not be noticed by the other participants and the UA process will have time to restart and reoccupy the node without any other UA noticing".
This will broadly mirror the behaviour of the UnitRelationState in python, but is IMO somewhat clearer (apart from anything else, departure is now explicit, rather than happening magically at process exit). YMMV; please let me know if it does, and how I could do it better :-).
R=niemeyer CC= https://codereview.appspot.com/6405044
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
310
|
|
|
William Reade |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|
309
|
|
|
Dave Cheney |
11 years ago
|
![Diff](/static/images/ico_diff.gif) |
|