mosquito-cr / mosquito

A background task runner for crystal applications supporting periodic (CRON) and manually queued jobs
MIT License
227 stars 24 forks source link

Auto-enqueue or perpetual jobs #144

Open robacarp opened 4 months ago

robacarp commented 4 months ago

Archive.fm has an endless source of work. Right now I have it tracking a periodic job which enqueues other jobs, and it checks to see how many enqueued jobs exist and fills it up to 10 each run.

This is fiddly:

I think there should be a way to build a job type which never stops, never stalls, and never needs to be enqueued. Perhaps a PerpetualJob? Perhaps this can be solved with an after run hook and a the observability API? How would that get kicked off when it stalls?