Does anyone have an understanding of the ice_cube
gem API? I'm trying to use it for sending reoccurring emails and I'm not sure if I understand if thats a valid use case for it or not. Does anyone have any examples? I can't find any anywhere. The existing documentations and tutorials are ambiguous and don't actually show an example of a repeating process taking place (like sending emails, deleting objects from a database, etc.). Thanks!
Asked
Active
Viewed 130 times
1

zasman
- 446
- 1
- 8
- 28
1 Answers
1
ice-cube itself isn't designed for this purpose. You'll want to use a processing tool like Sidekiq that actually runs tasks you create. ice-cube is a library tools like Sidekiq use to help with configuration, you don't need to use it directly.
If you're sending mails periodically e.g. every week, add a plugin like sidekiq-scheduler.
You could also just set up a cron job to send off mails according to a schedule, ifyour needs are moderate.

mahemoff
- 44,526
- 36
- 160
- 222
-
So when you have recurring events in ice cube, does that mean that a new event object will be created say, every day if it is scheduled to run every day? – zasman Jan 25 '18 at 17:17
-
It won't create events or run them. It's just a library to help you setup a schedule and ask questions like "when should the next event occur?". You can think of it as a kind of mini-database designed just for schedules. For typical email activity, most people would use a processor tool like Sidekiq or just a cron job. – mahemoff Jan 26 '18 at 10:33
-
1Thanks for the clarification! – zasman Jan 26 '18 at 17:00