Created
April 10, 2015 18:18
-
-
Save dsugden/9448e50a83ae601a4c93 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
object Application extends Controller with LazyLogging { | |
def index = Action.async { | |
val singlemicro = LocationService.getLookupUrl("/singlemicro", "http://127.0.0.1:8096/singlemicro") | |
val result = WS.url(singlemicro+"/singlemicro") | |
.withFollowRedirects(follow = true) | |
.get() | |
.map { response => | |
Ok(response.body) | |
} | |
val timeoutFuture = play.api.libs.concurrent.Promise.timeout(InternalServerError("Oops"), 2.second) | |
Future.firstCompletedOf[Result](Seq(result, timeoutFuture)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment