Stale Events

Variant of the deadly-embrace (or is the deadly-embrace a special case of this?)

Two objects (Foo and Bar) receive events from Baz, giving them notice of some index changing. The event object itself contains a copy of the index (commonly done). The index will be 0 when we jump into things.

Foo receives notice that the index changes to 1, and decides that it shouldn't be so, so it tells Baz to change it to 2.

Foo then receives notice that the index is now 2, and all is now good in the world from Foo's point of view.

Bar then receives the notice that the index is 2. Okay, it reports this to the user (or whatever you'd like it to do).

Bar now receives the original event that the index is 1. Which is, of course, incorrect.

What we really want is the event to merely point to the current value of Baz's index: it shouldn't cache the result. The resulting situation is that, although Bar will receive two event notifications, they will always report the correct index: stale events are no longer an issue.


This is of course only a problem if delivery of events is not guaranteed to be in order.


This is a symptom (a restatement?) of ObserverMustNotChangeObservable, which, IMHO, is a little clearer and provides possible solutions.


See also ObserverPattern, MultiCaster


EditText of this page (last edited April 16, 2014) or FindPage with title or text search