June 2018
Intermediate to advanced
310 pages
6h 32m
English
To test the Active Object pattern, we'll launch two jobs. One will send data to our actor:
val channel = Channel<String>()val actor = activeActor(channel)val j1 = launch { for (i in 42..53) { actor.send(i) } actor.close()}
And another will wait for output on the outbound channel:
val j2 = launch { for (i in channel) { println(i) }}j1.join()j2.join()
Read now
Unlock full access