basshelal / Waqti

Android app for a Kanban board time management system similar to Trello
MIT License
35 stars 7 forks source link

Migrate individual Task Observers to a single global Observable or TimerTask on all Tasks #117

Open basshelal opened 5 years ago

basshelal commented 5 years ago

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.