Problem:
Current Neo.core.Config subscriptions, especially with anonymous functions, lack clear ownership. This makes debugging challenging, as it's hard to identify which Neo.core.Base instance owns a specific subscription. This hinders memory leak detection and general application understanding.
Solution:
Modify Neo.core.Config#subscribe to strictly require an id (representing the owner's ID) and a callback fn. Subscriptions will be stored in an internal map (id -> Set<fn>).
Benefits:
- Enhanced Debugging: Easily inspect
Config#subscribers to see which Neo.core.Base instances are listening to a config, aiding in understanding data flow.
- Improved Diagnostics: Provides a crucial diagnostic tool for tracing memory leaks or unintended subscriptions back to their source instance.
- Future-Proofing: Lays the groundwork for more advanced subscription management tools and visualizations.
Impact:
Requires updates to Neo.core.Base#observeConfig and any other direct consumers of Neo.core.Config#subscribe to conform to the new signature.
Problem: Current
Neo.core.Configsubscriptions, especially with anonymous functions, lack clear ownership. This makes debugging challenging, as it's hard to identify whichNeo.core.Baseinstance owns a specific subscription. This hinders memory leak detection and general application understanding.Solution: Modify
Neo.core.Config#subscribeto strictly require anid(representing the owner's ID) and a callbackfn. Subscriptions will be stored in an internal map (id->Set<fn>).Benefits:
Config#subscribersto see whichNeo.core.Baseinstances are listening to a config, aiding in understanding data flow.Impact: Requires updates to
Neo.core.Base#observeConfigand any other direct consumers ofNeo.core.Config#subscribeto conform to the new signature.