Skip to content

Instantly share code, notes, and snippets.

@yuk1ty
Created March 3, 2018 02:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yuk1ty/5bb8519dbd6b706804d91eeca3ddcecb to your computer and use it in GitHub Desktop.
Save yuk1ty/5bb8519dbd6b706804d91eeca3ddcecb to your computer and use it in GitHub Desktop.
public void start() throws NioHttpServerException {
InputStream inputStream = inputStream();
requestHandler
.apply(inputStream)
.toStream()
.map(
v -> {
switch (v.status()) {
case OK:
return Optional.of(v.getResult());
case ERR:
return Optional.of(v.getError());
}
return Optional.empty();
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment