Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
RxRatpack
@Grab("io.ratpack:ratpack-rx:0.9.1")
import ratpack.launch.*
import ratpack.rx.internal.*
def cfg = LaunchConfigBuilder.baseDir(new File("/tmp")).build()
def rx = new DefaultRxBackground(cfg.background)
def list = ['fee', 'fie', 'fo', 'fum']
def str = ""
rx.observeEach { list }
.map { it.toLowerCase() }
.subscribe({
println "event"
str += it
}, { Throwable err ->
throw err
}, {
println "done :-) $str"
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment