Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Stops notifying consumers added during the notification process.
While trying out a synchronous scheduler, I found a case where notifying a `Consumer` caused a new `Consumer` to be added. This happened recursively and caused and infinite loop, repeatedly adding and then notifying a new `Consumer` endlessly. `Producer` objects should only notify existing `Consumer` objects, because those are the objects which are potentially dirty. Any `Consumer` added during the notification already observes the new value of the `Producer` and does not need to be notified. This avoids an infinite loop in the sync scheduler case and also reduces unnecessary notifications for a `Consumer` added at the wrong time.
- Loading branch information