I was thinking about using sneakers as my ActiveJob backend. Unfortunately it does not support delayed messages.
But since we're going to use clockwork anyway: is there any mechanism to schedule one-off jobs with clockwork
? I assume that it would have to be based on the database-backed job feature as the delayed jobs would have to survive application restarts.
Asked
Active
Viewed 141 times
0

Marcus Ilgner
- 6,935
- 2
- 30
- 44
-
I am not sure about if you can do one-off tasks with clockwork, but i would consider using [after_party](https://github.com/theSteveMitchell/after_party), it's similar to migrations in the sese that it runs only if it hasn't been run before, and this gets tracked in the db – max pleaner Jun 25 '18 at 19:08
-
Thank you for the suggestion! However I'm looking for a mechanism that isn't tied to migrations or deployments. I.e. anything that lets me use the regular `delay_for` feature of ActiveJob but with the `sneakers` adapter. – Marcus Ilgner Jun 25 '18 at 19:48
-
I'm not sure why you don't want it to be tied to deployment or migration. It doesn't have to happen at the exact moment you migrate / deploy. You can, inside the deployment / migration task, use `perform_at` to schedule a one-off job at a specific time. – max pleaner Jun 25 '18 at 20:56
-
That's the problem: with sneakers, the `perform_at` functionality isn't available so these tasks need to be scheduled in another way. – Marcus Ilgner Jun 26 '18 at 16:23
-
gotcha, sorry to not read the question well enough – max pleaner Jun 26 '18 at 16:53