artem-zinnatullin / qualitymatters

Android Development Culture

Home Page:https://artemzin.com/blog/android-development-culture-the-document-qualitymatters/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about AsyncJobsObserver

david-perez opened this issue · comments

I'm a little confused about the purpose of AsyncJobsObserver.

Firstly, is AsyncJobsObserver's sole purpose to track the execution of ongoing concurrent tasks? Does it have any other use besides testing?

Secondly, why is it named like that? Shouldn't it be named AsyncJobsObservable/Subject ? The way I see it, listeners (tests?) are registered via addListener() and notified whenever the number of running AsyncJobs changes, so the listeners are the Observers, and the number of running AsyncJobs is what's being observed. (Observer pattern)

For now it's only for testing, but you can create sort of debug UI and
attach it to observer and see what's going on in the app.

In QualityMatters v2 I'll remove it and won't add until necessary. Tests
will wait for UI conditions instead of async jobs to complete.

And yes, probably Subject is a better term :)

On Fri, 29 Jul 2016, 16:35 david-perez, notifications@github.com wrote:

I'm a little confused about the purpose of AsyncJobsObserver
https://github.com/artem-zinnatullin/qualitymatters/blob/master/app/src/debug/java/com/artemzin/qualitymatters/performance/AsyncJobsObserverImpl.java
.

Firstly, is AsyncJobsObserver's sole purpose to track the execution of
ongoing concurrent tasks? Does it have any other use besides testing?

Secondly, why is it named like that? Shouldn't it be named
AsyncJobsObservable/Subject ? The way I see it, listeners (tests?) are
registered via addListener() and notified whenever the number of running
AsyncJobs changes, so the listeners are the Observers, and the number of
running AsyncJobs is what's being observed. (Observer pattern
https://en.wikipedia.org/wiki/Observer_pattern)


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#196, or mute
the thread
https://github.com/notifications/unsubscribe-auth/AA7B3ErAh3LExXGfwE3GwkLFlNI5xc2eks5qagGzgaJpZM4JYMlv
.