开发者

Should verification emails be processed in the background?

Should verification emails be processed / sent in the background using some kind of background job (Resque, Delayed_Job, etc)?

The app does have a tendency to hang until a verification email is sent. However, it only hangs for a split second or two. Don't know if its worth sending over as a background task开发者_C百科.

What are your thoughts?


The main thing to keep in mind is that this delay isn't affecting just the current user, it's also affecting other users because it's holding up the Rails process (the exact effects of this will depend on the web server you're using and your setup).

If this application doesn't have a lot of users (and won't in the future) and you don't have any background job processing at the moment, then it may not be worth adding it. Otherwise it's probably a good idea.


If it's a few split seconds then I think that you can live with it. But if it takes longer then you may move it to delayed_job unless your delayed_job is always clogged and you are too much into background jobs. In that case it may take a bit longer to send the email to user and may ruin user experience. Even in that case you could set a higher priority for sending the verification emails.

I have no doubts about the capability of delayed_job and have been personally using it for quite some time now. Even Github recommends it while releasing resque:
https://github.com/blog/542-introducing-resque

We need a background job system as serious as our web framework. I highly recommend DelayedJob to anyone whose site is not 50% background work.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜