Created
May 21, 2019 06:56
-
-
Save objcode/9d3b347ffb34a71e1f7b5249849bfc77 to your computer and use it in GitHub Desktop.
Showing the start of joinPreviosOrRun
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
// see the complete implementation at | |
// https://gist.github.com/objcode/7ab4e7b1df8acd88696cb0ccecad16f7#file-concurrencyhelpers-kt-L124 | |
suspend fun joinPreviousOrRun(block: suspend () -> T): T { | |
// if there is an activeTask, return it's result and don't run the block | |
activeTask?.let { | |
return it.await() | |
} | |
// ... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment