raiden
raiden copied to clipboard
Change UserAddressManager to do polling instead of a pushing
Abstract
The current implementation of the UserAddressManager
is callback based, changes to a user's presence will trigger the user_presence_changed_callback
, and changes to the address' reachability will trigger address_reachability_changed_callback
. This model has caused a few problems:
- Crashes because the underlying map could be iterate over by one thread and modified by another.
- Bugs because the callbacks was not called on all code paths.
- A more complex/confusing interface because of the additional callbacks and a similarity to a thread interface.
Motivation
To prevent problems like the ones mentioned above, the code should be simplified to do polling instead of pushing.
Is this still the case? cc @fredo @ulope