Created
November 6, 2014 08:55
-
-
Save jbrisbin/c866f999c5e6eef716cf to your computer and use it in GitHub Desktop.
Ratpack Renderer for Reactor Streams
This file contains hidden or 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
@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