https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

dragas

08/28/2017, 12:56 PM
Is producer coroutine still held in
CommonPool
even after it has called
close()
on itself? For example
Copy code
fun doThings() : ProducerJob<Foo> = produce(CommonPool)
{
   println("I am do things!")
   delay(1000)
   send(Foo())
   close()
}
e

elizarov

08/28/2017, 2:19 PM
It will be done when it completes (returns from its body). Btw, you don’t need to invoke
close
at the end, as it is implicitly performed when the
produce
coroutine completes
d

dragas

08/29/2017, 7:22 AM
Ah, cheers.
3 Views