Hello,
you could do something like :
---8<---
module Rufus
MyScheduler = scheduler.new
end
#...
Rufus::MyScheduler.schedule_every('10d') { puts 'hello' }
--->8---
> I would really like something like Rufus::Scheduler.all_schedulers which will
> return all the schedulers in the system so I don't have to worry about
> persistence from within Rails itself.
Are you thinking about a hash ?
---8<---
Rufus::Scheduler.all_schedulers[:main_scheduler] = Scheduler.new
Rufus::Scheduler.all_schedulers[:main_scheduler].schedule("* * * * *")
{ puts 'hello' }
--->8---
maybe :
---8<---
class Rufus::Scheduler
def self.all_schedulers
(@all_schedulers ||= {})
end
end
--->8---
I don't understand the 'persistence' part of your question.
Rufus-scheduler doesn't do anything about persistence.
Best regards,
--
John Mettraux - http://jmettraux.wordpress.com
Makes lots of sense, I will think about it (initialization/starting
and stopping included).
Thanks and best regards,