July 2018
Intermediate to advanced
266 pages
7h 11m
English
In order to read a single element from a producer, the function receive() can be used, as follows for example:
val producer = produce { send(5) send("a")}fun main(args: Array<String>) { println(producer.receive()) println(producer.receive())}
his code will first print the number five, and then it will print the letter a.
Read now
Unlock full access