How to rewrite synchronous controller to be asynchronous in Play?

后端 未结 2 1468
终归单人心
终归单人心 2021-02-14 09:04

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:49

    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

提交回复
热议问题