Last active
June 8, 2016 05:26
-
-
Save mindwing/4e9cd9b7be62cfb4eb38f40e794658db to your computer and use it in GitHub Desktop.
Agera Explained - 08.Incrementally Agerifying legacy code
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
public class NetworkCallingFunction | |
implements Function<RequestBlob, Result<ResponseBlob>> { | |
@Override | |
public Result<ResponseBlob> apply(RequestBlob request) { | |
try { | |
ResponseBlob blob = networkStack.execute(request); | |
return Result.success(blob); | |
} catch (Throwable e) { | |
return Result.failure(e); | |
} | |
} | |
} | |
Function<RequestBlob, Result<ResponseBlob>> networkCallingFunction = | |
new NetworkCallingFunction(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment