{"action":"created","issue":{"url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/193","repository_url":"https://api.github.com/repos/yigit/android-priority-jobqueue","labels_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/193/labels{/name}","comments_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/193/comments","events_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/193/events","html_url":"https://github.com/yigit/android-priority-jobqueue/issues/193","id":161614296,"number":193,"title":"Make JobManager#count() callable on the UI thread","user":{"login":"LouisCAD","id":6975237,"avatar_url":"https://avatars.githubusercontent.com/u/6975237?v=3","gravatar_id":"","url":"https://api.github.com/users/LouisCAD","html_url":"https://github.com/LouisCAD","followers_url":"https://api.github.com/users/LouisCAD/followers","following_url":"https://api.github.com/users/LouisCAD/following{/other_user}","gists_url":"https://api.github.com/users/LouisCAD/gists{/gist_id}","starred_url":"https://api.github.com/users/LouisCAD/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LouisCAD/subscriptions","organizations_url":"https://api.github.com/users/LouisCAD/orgs","repos_url":"https://api.github.com/users/LouisCAD/repos","events_url":"https://api.github.com/users/LouisCAD/events{/privacy}","received_events_url":"https://api.github.com/users/LouisCAD/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yigit/android-priority-jobqueue/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-06-22T07:45:46Z","updated_at":"2016-06-23T07:34:42Z","closed_at":null,"body":"Hi,\r\n\r\nI would like to be able to show the pending jobs in the JobManager in the settings of my app. However, the code I need to write to make this work is spaghetti like because `count()` is not callable on the UI thread, and using a `JobManagerCallback` to get notified when a job is done or added to update the pending jobs count shown in the UI is overkill.\r\n\r\nWhy the JobManager don't just increment an internal int field named `count` each time `addJob(...)` or `addJobInBackground(...)` is called, and decrement it when a job is done or cancelled, using possibly an AtomicInteger if these events (job added, done or cancelled) are not synchronized on the UI thread?\r\n\r\nAnd any advice on how to listen for count changes with the simplest code possible?"},"comment":{"url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/comments/227972604","html_url":"https://github.com/yigit/android-priority-jobqueue/issues/193#issuecomment-227972604","issue_url":"https://api.github.com/repos/yigit/android-priority-jobqueue/issues/193","id":227972604,"user":{"login":"yigit","id":89202,"avatar_url":"https://avatars.githubusercontent.com/u/89202?v=3","gravatar_id":"","url":"https://api.github.com/users/yigit","html_url":"https://github.com/yigit","followers_url":"https://api.github.com/users/yigit/followers","following_url":"https://api.github.com/users/yigit/following{/other_user}","gists_url":"https://api.github.com/users/yigit/gists{/gist_id}","starred_url":"https://api.github.com/users/yigit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yigit/subscriptions","organizations_url":"https://api.github.com/users/yigit/orgs","repos_url":"https://api.github.com/users/yigit/repos","events_url":"https://api.github.com/users/yigit/events{/privacy}","received_events_url":"https://api.github.com/users/yigit/received_events","type":"User","site_admin":false},"created_at":"2016-06-23T07:34:42Z","updated_at":"2016-06-23T07:34:42Z","body":"sorry I meant single id:\r\nhttp://yigit.github.io/android-priority-jobqueue/javadoc/com/birbit/android/jobqueue/Params.html#setSingleId-java.lang.String-"}}
{"actor":{"display_login":"yigit"}}