SIGN IN SIGN UP

[EventDispatcher][Messenger] Add ScopedEventDispatcher, stop mutating the dispatcher of the application

A worker registers its stop listeners on the dispatcher it is given, and removes
them when the run ends. ScopedEventDispatcher gives those listeners the lifetime
of the run without touching the shared dispatcher: it holds them itself, copies
the listeners of the wrapped dispatcher over when one is added for the same
event so that the two sets interleave by priority, and hands an event no
listener was added for to the wrapped dispatcher.
N
Nicolas Grekas committed
5e1ee82d26e4846e6daae477ece8cd8a30ca21b3
Parent: 2c21773