[Kotlin] Coroutine 에 대한 이해 : 기본 용어 및 사용 https://android.jlelse.eu/coroutines-basic-terminologies-and-usage-b4242bd1b2a4 Coroutine 이 뭐냐? -Coroutine 은 suspendable computaion instance 이다.코드 블럭이 life-cycle 을 가지고 생성되고 수행된다는 것이 개념상 thread 와 비슷하지만, 특정 thread 에 bound 되어 있지 않다.한 thread 에서 실행되고, 다른 thread 에서 resume 될 수도 있다.future 와 같이 result 나 exception 으로 종료될 수 있다. -Coroutine 은 lightweight thread 라고 볼 수 있다.여러개의 function 을 async 로 호출할 수 있고, 더 짧.. 2020. 8. 7. [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 다음