How to rewrite synchronous controller to be asynchronous in Play?

后端 未结 2 571
刺人心
刺人心 2021-02-14 08:55

I\'m using Play framework 2.2 for one of my upcoming web application. I have implemented my controllers in synchronous pattern, with several blocking calls (mainly, database).

2条回答
  •  迷失自我
    2021-02-14 09:47

    It you don't have anything to not block on then there may not be a reason to make your controller async. Here is a good blog about this from one of the creators of Play: http://sadache.tumblr.com/post/42351000773/async-reactive-nonblocking-threads-futures-executioncont

提交回复
热议问题