Created
October 18, 2020 12:04
-
-
Save chaxiu/d8f6a586a263ac11320746bdb1aeed28 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
// "fake" suspending function | |
// Although it has suspend modifier, | |
// it will not really suspend when executed, | |
// because there is no other suspending in its body | |
// ↓ | |
suspend fun noSuspendFriendList(user: String): String{ | |
return "Tom, Jack" | |
} | |
suspend fun testNoSuspend() { | |
log("start") | |
val user = getUserInfo() | |
log(user) | |
// changes | |
// ↓ | |
val friendList = noSuspendFriendList(user) | |
log(friendList) | |
val feedList = getFeedList(friendList) | |
log(feedList) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment