Skip to content

Instantly share code, notes, and snippets.

@athulantonynp
Created May 10, 2018 13:32
Show Gist options
  • Select an option

  • Save athulantonynp/fcfb38f63ecec368733ff244c01ebcfd to your computer and use it in GitHub Desktop.

Select an option

Save athulantonynp/fcfb38f63ecec368733ff244c01ebcfd to your computer and use it in GitHub Desktop.
WorkManagerParallel
//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