Skip to content

Instantly share code, notes, and snippets.

@dsugden
Created April 10, 2015 18:18
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 dsugden/9448e50a83ae601a4c93 to your computer and use it in GitHub Desktop.
Save dsugden/9448e50a83ae601a4c93 to your computer and use it in GitHub Desktop.
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