Skip to content

Instantly share code, notes, and snippets.

@jbrisbin
Created November 6, 2014 08:55
Show Gist options
  • Save jbrisbin/c866f999c5e6eef716cf to your computer and use it in GitHub Desktop.
Save jbrisbin/c866f999c5e6eef716cf to your computer and use it in GitHub Desktop.
Ratpack Renderer for Reactor Streams
@Bean
public Renderer<Stream> personRenderer() {
return new RendererSupport<Stream>() {
@Override
public void render(Context ctx, Stream s) throws Exception {
ctx.promise(f -> s.consume(f::success))
.then(o -> ctx.render(json(o)));
}
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment