[kotlin] CoroutineContext 에 대한 이해 - Kotlin coroutine 의 핵심은 CoroutieContext interface 이다. 모든 launch, async 같은 coroutine builder 는 첫번째 param 으로 CoroutineContext 를 받는다. 이 coroutine builder 들은 CoroutineScope interface 의 extension function 으로 정의되어 있으며, abstract read-only property 로 coroutineContext 를 가지고 있다. - fun CoroutineScope.launch( context: CoroutineContext = EmptyCoroutineContext, start: CoroutineStart = CoroutineStart.DEFAULT,.. 2022. 2. 3. [coroutine] exception 을 이해해보자 #1 ( in my coroutine scope ) -이 글은 coroutine exception 에 대한 일종의 심화과정이라고 볼 수 있다.기본 exception 에 대한 내용을 먼저 이해한 후 이곳의 글을 보자![coroutine] Exception handling -class MainActivity : Activity() { private val coroutineScope = CoroutineScope(Dispatchers.Main) override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContentView(R.layout.activity_main) findViewById(R.id.btn).setOnClickListener { try { co.. 2019. 3. 5. 반응형 이전 1 다음