C
C#3mo ago
Core

✅ Background jobs, choosing the right library

Hello, I need to implement a scheduled job that will be periodically executed. Why are there so many libraries: Hangfire, Quartz, Coravel? Even .NET offeres the BackgroundService out of the box. How do I choose the right library? Literally every one of them gets the job done...
10 Replies
Pobiega
Pobiega3mo ago
They all have their own tradeoffs. Is it a one off, or do you have multiple jobs? What about multiple worker instances?
Core
CoreOP3mo ago
I would have multiple jobs, not just one. But each one would query the DB
Pobiega
Pobiega3mo ago
Okay. What about an admin panel to run jobs manually etc? Is that something you need, or not relevant And the amount of running instances question is still important Ie, if you have three running instances, would it be a problem if all three ran the job?
Core
CoreOP3mo ago
I was thinking of usign distributed locking mechanism, so the task wouldn't be executed by multiple instances
Pobiega
Pobiega3mo ago
That works. Otherwise, hangfire and quartz have that built in if wanted I'd probably recommend go with coravel if you don't need manual triggering
Core
CoreOP3mo ago
Sorry, I forgot to mention that part, no GUI is needed, everything should be executed programmatically Thank you
Pobiega
Pobiega3mo ago
There is an important caveat thou, coravel defaults to UTC If you want to specify scheduled times in local TZ, don't forget to apply that modifier
Core
CoreOP3mo ago
I'm using Utc both in DB, and application
Pobiega
Pobiega3mo ago
Ok, np then
Core
CoreOP3mo ago
Thanks again
Want results from more Discord servers?
Add your server