Johann Pardanaud
05/26/2023, 10:23 AMmySuspendableFunction
but what would be the name of the other function? myNonSuspendableFunction
seems a bit too verbose.
Or maybe should I go with myAsyncFunction
and mySyncFunction
? But those `async`/`sync` words are never used in Kotlin's terminology.Youssef Shoaib [MOD]
05/26/2023, 10:26 AMBlocking
is the convention for a non-suspending variation of a function. Usually, we also just name the suspending function without highlighting that it is suspending, because the type system takes care of thatJohann Pardanaud
05/26/2023, 10:42 AMclass BlockingClass {
operator fun invoke(): Unit = TODO()
}
class SuspendableClass {
suspend operator fun invoke(): Unit = TODO()
}
Youssef Shoaib [MOD]
05/26/2023, 12:10 PMClass
and BlockingClass
,Johann Pardanaud
05/26/2023, 3:01 PMRuckus
05/26/2023, 3:45 PMClass
and the second something like AsyncClass
or whatever that demonstrates how it's intended use deviates from the default mode.