The first client that desperately needs lifecycles to work is the unit agent, which needs to track relation lifecycle. I hope I'm not going to regret this, but I *think* that all I need is a ServiceRelationsWatcher that produces these:
type RelationsChange struct {
Changed []*Relation
}
The initial event should contain every relation, whatever its state; subsequent ones should contain only the relations whose state has changed since the last event. I have come to the conclusion that I actually don't need separate Alive/Dying/Dead fields in the event.
(Relation needs Life and SetLife, or whatever it was we agreed on.)
The first client that desperately needs lifecycles to work is the unit agent, which needs to track relation lifecycle. I hope I'm not going to regret this, but I *think* that all I need is a ServiceRelation sWatcher that produces these:
type RelationsChange struct {
Changed []*Relation
}
The initial event should contain every relation, whatever its state; subsequent ones should contain only the relations whose state has changed since the last event. I have come to the conclusion that I actually don't need separate Alive/Dying/Dead fields in the event.
(Relation needs Life and SetLife, or whatever it was we agreed on.)