asad.awadia
11/22/2018, 2:48 AMgildor
11/22/2018, 3:07 AMasad.awadia
11/22/2018, 3:14 AMgildor
11/22/2018, 3:26 AMmainly uses coroutines to switch work from main threadNot only
Dico
11/22/2018, 9:38 AMasad.awadia
11/22/2018, 10:25 AMgildor
11/22/2018, 1:20 PMdelay
can be replaced with ANY async operation: db request, network request, any other IO, depending on you use case and your projectasad.awadia
11/22/2018, 1:21 PMgildor
11/22/2018, 2:03 PMasad.awadia
11/22/2018, 2:04 PMgildor
11/22/2018, 2:05 PMwithContext(<http://Dispatchers.IO|Dispatchers.IO>)
As a template more than anythingTemplate for what? You can use coroutines with any project that have async libraries. Ideally you shouldn't wrap blocking calls, but use async API and coroutines adapter for this API
asad.awadia
11/22/2018, 2:12 PMgmariotti
11/22/2018, 5:14 PMasad.awadia
11/22/2018, 5:30 PMSiebelsTim
11/22/2018, 10:01 PMFelix
11/28/2018, 6:26 PMsuspendCoroutine
works
2) An example using a Spring Controller
https://speakerdeck.com/pmhsfelix/using-kotlin-coroutines-for-asynchronous-and-concurrent