It's a simple thing but i have no idea how i can do it in Scala. I want to return a true
in a Future
. I use the twitter Future
. But I want to return it as fast as possible. Like this:
def saveOrUpdate(pageImpression: PageImpressions): com.twitter.util.Future[Boolean] = {
return com.twitter.util.Future.value(true)
count += 1
println(count)
}
But this wouldn't work. How I can return something but also continuing the execution? It's a HTTP service. The return value will returned to the HTTP client.