I know, that my question is easy for you, but not for me, because I'm
beginner with RoR.
So...
My application sends a lot of emails - not only for confirm
registration, change password, but others. I take time if I do this by
request.
My application also creates many files - it takes a time too...
Is there a good way for sending email in background?
Is there a good way for scheduling jobs?
Emails are really sent in the background since they will be queued by sendmail or similar. If you plan on sending a ton of emails in one request, I would suggest setting something up with crontab to execute at timed intervals.
You can create a model and put your logic in there and then add a crontab entry
I said, that emails are sent in the background so why request is longer
than when I use spawn? It can be other reason?
and question about crontab:
Generally the idea is clear, but tell me, how my some_method invoked in
crontab knows which email should be send?
Should I use e.g. table jobs, where I put information which email and to
whom it should me send? And some_method should checking this jobs?