import Ġkotlinx . coroutines . Coroutine Scope Ċ import Ġkotlinx . coroutines . channels . Receive Channel Ċ import Ġkotlinx . coroutines . channels . consume Each Ċ import Ġkotlinx . coroutines . channels . produce Ċ import Ġkotlinx . coroutines . run Blocking Ċ Ċ fun Ġmain () Ġ= Ġrun Blocking < Unit > Ġ{ ĊĠĠĠ Ġmy Producer (). consume Each Ġ{ Ġprintln ( it ) Ġ} Ċ } Ċ Ċ fun ĠCor outine Scope . my Producer (): ĠReceive Channel < Int > Ġ= Ġproduce Ġ{ ĊĠĠĠ Ġrepeat ( 5 ) Ġ{ ĊĠĠĠĠĠĠĠ Ġsend (( Math . random () Ġ* Ġ 1 0 ). toInt ()) ĊĠĠĠ Ġ} Ċ }