I am confused by the job and queue. And have hard time to use them in my application.
Basically, I need to send reminder to users when their tasks are due daily. There are many tasks in the database table, query them will takes a lot of time. Hence I would like the process run in background.
Upon checking the tasks due date, it will send a notification to the users.
What I come in mind is, separated the db query and send notification process by different time.
Eg, in midnight 1am , I will schedule to run the collecting data first (query database and get necessary data).
And then in the morning send the notification according the due tasks found in 1am.
How can I do it?
Do I need to do 2 cron jobs to do the process? 1 for collect data (querying db) and 1 for send notification?
But according to documentation, all I need is create one cron job and using scheduler to schedule the process. This I not understand how can I do it.
Also In the document, it has mentioned Job Chaining method, from what I understanding, it only order the jobs priority. It can't be run the job by specific time.
Also, if i create a job of collecting data, does it run in the background?