Created
March 3, 2018 02:21
-
-
Save yuk1ty/5bb8519dbd6b706804d91eeca3ddcecb to your computer and use it in GitHub Desktop.
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
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