Skip to content

5주차 #14

@chaeniiz

Description

@chaeniiz
  1. 115p 왜 catch 안에 있는 거 안 찍힐까?
fun main(): Unit = runBlocking {
    // try-catch 구문으로 래핑하지 마세요. 무시됩니다.
    try {
        launch {
            delay(1000)
            throw Error("Some error")
        }
    } catch (e: Throwable) { // 여기선 아무 도움이 되지 않습니다.
        println("Will not be printed")
    }
    launch {
        delay(2000)
        println("Will not be printed")
    }
}
// Exception in thread "main" java.lang.Error: Some error...
  1. 118p 문장이 이해가 안 간다
    하나의 코루틴이 취소되어도 다른 코루틴이 취소되지 않는다는 점에서, 같은 잡을 다수의 코루틴에서 컨텍스트로 사용하는 것이 좀 더 나은 방법입니다.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions