package Ġcom . ba eld ung . ch ann les Ċ Ċ import Ġkotlinx . coroutines . channels . ticker Ċ import Ġkotlinx . coroutines . delay Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġjava . time . Duration Ċ import Ġkotlin . random . Random Ċ Ċ fun Ġstock Price ( stock : ĠString ): ĠDouble Ġ{ ĊĠĠĠ Ġlog (" Fetching Ġstock Ġprice Ġof Ġ$ stock ") ĊĠĠĠ Ġreturn ĠRandom . next Double ( 2 . 0 , Ġ 3 . 0 ) Ċ } Ċ Ċ fun Ġmain () Ġ= Ġrun Blocking Ġ{ ĊĠĠĠ Ġval Ġticker Channel Ġ= Ġticker ( Duration . of Seconds ( 5 ). to Millis ()) ĊĊĠĠĠ Ġrepeat ( 3 ) Ġ{ ĊĠĠĠĠĠĠĠ Ġticker Channel . receive () ĊĠĠĠĠĠĠĠ Ġlog ( stock Price (" TES LA ")) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġdelay ( Duration . of Seconds ( 1 1 ). to Millis ()) ĊĠĠĠ Ġticker Channel . cancel () Ċ } Ċ