Wednesday, 11 September 2013

Play Framework: How to use await in Model?

Play Framework: How to use await in Model?

I have a method in my Model which make HTTP Requests and then returns the
result. I want to make these HTTP Requests asynchronous. I went through
the documentation on writing Asynchronous code with Play and it uses the
'await' or 'waitfor' method. However, I can't use these methods in Model.
Is there a work around for this? I though of using onRedeem on the
Promise, but onRedeem continues the processing and the method ultimately
calls return without the response being set

No comments:

Post a Comment