Skip to content

Instantly share code, notes, and snippets.

View jgreenyer's full-sized avatar

Joel jgreenyer

View GitHub Profile
@jgreenyer
jgreenyer / ScenarioProgrammingInKotlin.kt
Last active February 22, 2019 10:31
Scenario-based programming in Kotlin using coroutines and channels -- minimal example
package scenarioprogramming
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
open class Event(val name: String) {}
sealed class AbstractSyncMessage()
object TerminationMessage : AbstractSyncMessage()