Currently we create an Observer for each Task in the Cache, Observers are somewhat memory expensive, and we run these every second or so, so if we have thousands of Tasks in the Cache then every second thousands of Observers will run their onNext().
We could probably easily convert this into one Observer (or TimerTask) for the entire app, that will run on all Tasks in the Cache, this will be more memory efficient and will remove the possibility of memory leaks from Tasks since Tasks don't directly contain Observers, there is one that runs as long as the app is running.
Currently we create an
Observer
for each Task in the Cache,Observer
s are somewhat memory expensive, and we run these every second or so, so if we have thousands of Tasks in the Cache then every second thousands ofObserver
s will run theironNext()
.We could probably easily convert this into one
Observer
(orTimerTask
) for the entire app, that will run on all Tasks in the Cache, this will be more memory efficient and will remove the possibility of memory leaks from Tasks since Tasks don't directly contain Observers, there is one that runs as long as the app is running.