开发者

Grails: async service in 1.3.7

开发者 https://www.devze.com 2023-03-29 06:26 出处:网络
I have a mail service that uses mail plugin to send out notification. I have this triggered 开发者_如何学JAVAof the save method. What I have noticed is that the save method is now slower because part

I have a mail service that uses mail plugin to send out notification. I have this triggered 开发者_如何学JAVAof the save method. What I have noticed is that the save method is now slower because part of the processing time is generating email template off the GSP and sending the message to the smtp host. What is the best strategy to speed up this proccess? I am thinking some kind of async processing. Are there facilities in Grails or Groovy that I can use (do I fall back to threads...?).


Yes, there are several alternatives for async processing in Grails. I ended using the Executor plugin for the exact same use-case as you and it works like a charm.

0

精彩评论

暂无评论...
验证码 换一张
取 消