fun CoroutineScope.launch( context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = Coroutinestart.DEFAULT, block: suspend CoroutineScope.() -> Unit): Job { ...}코루틴 빌더 함수의 시그니처 첫 번째 파라미터가 CoroutineContext라는 사실을 알 수 있다.빌더 함수의 리시버뿐만 아니라 마지막 인자의 리시버도 CoroutineScope 타입이다. interface CoroutineScope { val coroutineContext: CoroutineContext}CoroutineScope는 CoroutineConte..
중단 함수는 Continuation 객체를 다른 중단 함수로 전달한다.따라서 중단 함수는 일반 함수를 호출할 수 있지만, 일반 함수는 중단 함수를 호출할 수 없다.모든 중단 함수는 다른 중단 함수에 의해 호출되어야 한다. 이때 중단 함수를 시작하는 지점이 코루틴 빌더다.코루틴 빌더는 일반 함수와 중단 함수를 연결시키는 다리가 된다.kotlinx.coroutines 라이브러리가 제공하는 필수적인 코루틴 빌더 세 가지를 탐색해 보자.launchrunBlockingasync launch 빌더thread 함수를 호출하여 새로운 스레드를 시작하는 것과 비슷하다.코루틴을 시작하면 별개의 작업으로 실행된다.fun main() { GlobalScope.launch { delay(1000L) ..