Created
March 6, 2019 13:01
-
-
Save robertlevonyan/771cf97dcfca86a14d205bbc9313ea17 to your computer and use it in GitHub Desktop.
This file contains 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
fun chainWorks(filter1: Work, filter2: Work, compress: Work, upload: Work) { | |
WorkManager.getInstance() | |
// Run these works in parallel | |
.beginWith(listOf(filter1, filter2)) | |
// Dependent work (only runs after all previous work in chain) | |
.then(compress) | |
.then(upload) | |
// Don't forget to enqueue() | |
.enqueue() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment