Created
August 23, 2018 21:14
-
-
Save madsunrise/3b29d7f0084dd0018688fb5f0afd17b3 to your computer and use it in GitHub Desktop.
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
| fun <T> runSynchronously(asyncFunc: (callback: CallbackWithResult<T>) -> UUID): T { | |
| var result: T? = null | |
| asyncFunc.invoke(CallbackWithResult { | |
| result = it | |
| }) | |
| while (true) { | |
| result?.let { return it } | |
| Thread.sleep(250); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment