Created
May 10, 2018 13:32
-
-
Save athulantonynp/fcfb38f63ecec368733ff244c01ebcfd to your computer and use it in GitHub Desktop.
WorkManagerParallel
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //For sequential work ordering. | |
| WorkManager.getInstance() | |
| .beginWith(work1) | |
| .then(work2) | |
| .then(work3) | |
| .enqueue(); | |
| WorkManager.getInstance() | |
| // First, all 1 tasks in parallel | |
| .beginWith(work1, workA12, work13) | |
| // ...when all 1 tasks are finished, run the single 2 task: | |
| .then(work2) | |
| // ...then run the 3 tasks (in any order): | |
| .then(work3) | |
| .enqueue(); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment