You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In multi-threaded applications, it's currently possible for calls to unsubscribe to complete while event dispatch is ongoing. This could end up being problematic, such an example could be a cleanup routine that runs immediately after unsubscribe and invalidates objects referenced by an event callback. In these situations, a synchronous ListenerList implementation would be necessary, implemented using either a mutex or read-write lock depending on the setup.
Currently, all ListenerList usages are backed by CopyOnWriteListenerList, which is hard-coded into EventManager.
Extensibility
Configurable ListenerList implementation via EventBusBuilder
ListenerList
Single-threaded implementation
Mutex wrapper
Read-write lock wrapper
The text was updated successfully, but these errors were encountered:
In multi-threaded applications, it's currently possible for calls to unsubscribe to complete while event dispatch is ongoing. This could end up being problematic, such an example could be a cleanup routine that runs immediately after unsubscribe and invalidates objects referenced by an event callback. In these situations, a synchronous
ListenerList
implementation would be necessary, implemented using either a mutex or read-write lock depending on the setup.Currently, all
ListenerList
usages are backed byCopyOnWriteListenerList
, which is hard-coded intoEventManager
.Extensibility
ListenerList
The text was updated successfully, but these errors were encountered: