I want to collect data in an aggregation and execute it as a batch in an interval. How can I achieve this in Hangfire?
For instance, say that I add emails in an aggregation:
mails.Add(email);
Now I want a Hangfire job to pickup all the mails
and execute a single job for it:
// Function that runs daily or when there are more than 100 mails
Task SendMails(List<string> mails) {
send_batch(mails);
}
How can I achieve this in Hangfire?