Created
October 20, 2021 16:00
-
-
Save ermadmi78/4c1e47111d3586639e3217b6427badc3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Instantiate DSL context | |
val context = cinemaContextOf(createKtorAdapter()) | |
launch(Dispatchers.Default) { | |
context.subscription { | |
filmCreated { | |
id() | |
title() | |
} | |
}.subscribe { | |
while (true) { | |
val result = receive() | |
result.filmCreated.also { film -> | |
println(film.title) | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment