I just want to know how the delay job gem works. I am confused how it
detects when the server is having less load and does computing intensive
job at that time.
Or it just tries to do some thing, if it fails, waits for random time
and does it again?
DelayedJob just creates anotar thread and a send the email or execute the method on parallel without stop the ruby thread! You can set a delay to call the method but it does not works as you throught!
I just want to know how the delay job gem works. I am confused how it
detects when the server is having less load and does computing intensive
job at that time.
It doesn’t. You run separate delayed job workers that try to process the queue of delayed jobs as fast as they can. Delayed job isn’t about waiting for a less busy time - it’s mostly about decoupling the job result from the http response.
Or it just tries to do some thing, if it fails, waits for random time
and does it again?
If a job does fail it does exponential backoff, upto a configurable limit (a default of 25 attempts I think)