On Jul 18, 8:04 pm, "John Mettraux" <[EMAIL PROTECTED]> wrote:
> Maybe something like
>
> ---8<---
> unless defined? $scheduler
> $scheduler = OpenWFE::Scheduler.new
> $scheduler.start
> #...
> end
> --->8---
That wouldn't work between script/server and script/console, would it,
since those are basically two instantiations of the application?
$scheduler isn't shared across runs of the app.
> The methods schedule(), schedule_at() and schedule_every() each
> returns a 'jobid' when called.
>
> You can do :
>
> ---8<---
> jobid = $scheduler.schedule_every("10s") { puts "hello !" }
>
> #... a bit later
>
> $scheduler.unschedule(job_id)
> --->8---
I had noticed the job ID, and inspected the class, but didn't see the
unschedule method. Thanks for pointing it out.
> It's true the schedule_at() will trigger task in the past immediately
> and not schedule them.
>
> But should we consider that a bug ? It's a bit weird to have absolute
> dates in your program. Why don't you use a [cron] schedule() ?
Weird, yes. The reason I can't use cron-style scheduling is because I
want to schedule something (for example) for two days before the end
of the month. You can't do that with "every 28th of the month".
Could I convince you that running a schedule_at item from the past is
a bug? :-)
Thanks for all the help!
Lee
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"OpenWFEru users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/openwferu-users?hl=en
-~----------~----~----~----~------~----~------~--~---