The API for Service#running() says:
bq. This method is invoked after any listeners of the state property and after the Task has been fully transitioned to the new state.
It's the same for scheduled(), failed(), etc.. However, all of those convenience methods run before listener notification, not after. For me, the preferred behavior is the behavior described in the API.
Here is an SSCCE using running() as an example: http://pastebin.com/Dzr3GLj9
Expected output:
OS: Windows 8.1
Version: 1.8.0_05
VM Info: 25.5-b02 (amd64)
----------------------------------------
observed RUNNING
running()
Actual output:
OS: Windows 8.1
Version: 1.8.0_05
VM Info: 25.5-b02 (amd64)
----------------------------------------
running()
observed RUNNING
I'm not very familiar with the way the dispatching works, but Task looks very similar and functions correctly.
For reference, here is a similar SSCCE for Task: http://pastebin.com/1hTAJh6K
bq. This method is invoked after any listeners of the state property and after the Task has been fully transitioned to the new state.
It's the same for scheduled(), failed(), etc.. However, all of those convenience methods run before listener notification, not after. For me, the preferred behavior is the behavior described in the API.
Here is an SSCCE using running() as an example: http://pastebin.com/Dzr3GLj9
Expected output:
OS: Windows 8.1
Version: 1.8.0_05
VM Info: 25.5-b02 (amd64)
----------------------------------------
observed RUNNING
running()
Actual output:
OS: Windows 8.1
Version: 1.8.0_05
VM Info: 25.5-b02 (amd64)
----------------------------------------
running()
observed RUNNING
I'm not very familiar with the way the dispatching works, but Task looks very similar and functions correctly.
For reference, here is a similar SSCCE for Task: http://pastebin.com/1hTAJh6K