I received feedback from some of you, saying that it would be cool if
RailsCron was even easier to manage. So I implemented a graceful
start/restart inside of the plugin’s init.rb. If you don’t like it,
comment it out and send me the feedback.
Also, I finished an update to RailsCron that allows you to attach
asynchronous processing methods to your ActiveRecord models. i.e.:
class EmailQueue < ActiveRecord::Base
background :deliver, :every => 10 #seconds, or 1.minute, etc
def self.deliver
#process the queue
end
end
If your deliver method takes a minute to process (like some of my
async methods do), then RailsCron will NOT load up multiple threads of
the same command every 10 seconds. Rather RailsCron checks to see if
the command is currently running, and doesn’t start a new one. You
can overrride this with:
RailsCron.options[:overlap] = true
Is there a better name to use than overlap? Anyhow, have fun, and
feedback is always welcome and encouraged!
Repository:
http://svn.kylemaxwell.com/rails_cron/
Bug Tracker:
http://dev.kylemaxwell.com
–
Kyle M.
Chief Technologist
E Factor Media // FN Interactive
removed_email_address@domain.invalid
1-866-263-3261