RxRatpack
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
@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