in this post Angular.js with Scalatra it is said that the http call is asynchronous. I see that the call to the actor is done with:
myActor ? q
however in scalatra home page i see they encapsulate the call with AsyncResult see:
get("/"){
new AsyncResult { def is =
Future {
// Add async logic here
<html><body>Hello Akka</body></html>
}
}
}
is there a difference between the two? I understand that the first one is calling an actor which returns a future, does that mean that both calls are async?
can you elaborate a little more about how the synchronicity of
get("/query/:key/:value") {
contentType = formats("json")
val q = Query(params("key"), params("value"), mongoColl)
myActor ? q
}
is the http thread released?