Hi
I am writing an email notification system using GenStage
Stages:
A : Fetch scheduled notifications from DB (producer) in batches.
B: For each notification, find subscribed users in batches (producer_consumer)
C: For each user, populate an email template with the user’s data + notification data (producer_consumer)
D: For each populated email template, send it off to mail server (consumer)
I’d like to run this sequence from a CRON job every hour. It should keep running until all scheduled notifications in the DB has been handled. Once that is done, it should wait until the next hour
What is the best way to accomplish this?