ossgang / ossgang-commons

Apache License 2.0
4 stars 0 forks source link

Remove the static GC protection mechanism for observables. #66

Closed michi42 closed 3 years ago

michi42 commented 3 years ago

Instead, make sure that derivations keep the upstream observables alive, and are kept alive themselves (by the upstream) as long as subscriptions exist.

Signed-off-by: mihostet michi.hostettler@cern.ch

codecov-commenter commented 3 years ago

Codecov Report

Merging #66 (72a096c) into master (903b3d1) will decrease coverage by 0.38%. The diff coverage is 84.37%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master      #66      +/-   ##
============================================
- Coverage     76.90%   76.52%   -0.39%     
+ Complexity      409      405       -4     
============================================
  Files            52       53       +1     
  Lines          1139     1150      +11     
  Branches         78       77       -1     
============================================
+ Hits            876      880       +4     
- Misses          224      230       +6     
- Partials         39       40       +1     
Impacted Files Coverage Δ
...a/org/ossgang/commons/observables/Observables.java 54.54% <ø> (ø)
...ava/org/ossgang/commons/observables/Observers.java 77.77% <0.00%> (+9.59%) :arrow_up:
...g/commons/observables/PeriodicObservableValue.java 71.42% <50.00%> (-28.58%) :arrow_down:
...mmons/observables/WeakMethodReferenceObserver.java 83.33% <79.31%> (-5.56%) :arrow_down:
...ang/commons/observables/DispatchingObservable.java 91.22% <83.33%> (-7.05%) :arrow_down:
...les/operators/AbstractOperatorObservableValue.java 93.33% <93.33%> (ø)
.../org/ossgang/commons/awaitables/BaseAwaitable.java 80.64% <100.00%> (ø)
...in/java/org/ossgang/commons/monads/AsyncMaybe.java 86.66% <100.00%> (+0.22%) :arrow_up:
...ommons/observables/DispatchingObservableValue.java 92.00% <100.00%> (-4.00%) :arrow_down:
...bservables/operators/DebouncedObservableValue.java 100.00% <100.00%> (+14.28%) :arrow_up:
... and 5 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 903b3d1...72a096c. Read the comment docs.

andreacalia commented 3 years ago

Tried to extract a base class for operators (any stage that subscribe upstream).

andreacalia commented 3 years ago

Shall we deprecate the WeakMethodReferenceObserver since the changes introduced in the memory management of the observables?