Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
basshelal opened this issue Nov 5, 2019 · 0 comments
Assignees
Labels
Backend Something regarding the backend code Need Refactors Something needs refactoring of some sorts

Comments

@basshelal
Copy link
Owner

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.

@basshelal basshelal added Need Refactors Something needs refactoring of some sorts Backend Something regarding the backend code labels Nov 5, 2019
@basshelal basshelal self-assigned this Nov 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Backend Something regarding the backend code Need Refactors Something needs refactoring of some sorts
Projects
None yet
Development

No branches or pull requests

1 participant