Hi Lee,

BTW, where are you based ? I'm in Yokohama, Japan.


On 7/19/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> 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.

You're right. What about a file semaphore (IIRC, as you suggested
before). Or simply something that notices that the console is being
triggered and not the application itself. $0 ?

---8<---
sonanda:~/openwfe-ruby mettraux$ irb
irb(main):001:0> puts $0
irb
=> nil

sonanda:~/openwfe-ruby mettraux$ ruby -e "puts $0"
-e:1: undefined local variable or method `bash' for main:Object (NameError)
--->8---


> I had noticed the job ID, and inspected the class, but didn't see the
> unschedule method. Thanks for pointing it out.

http://openwferu.rubyforge.org/rdoc/classes/OpenWFE/Scheduler.html
(double checking, yes it's documented).


> > 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? :-)

Well, I rely on this behaviour in some of my applications (and also
Nicolas). What about something like :

scheduler.schedule_at(past_moment, :discard_past => true) do
    #whatever
end

When the parameter :discard_past is set to true, if the event is due
for the past, it would not be executed at all (and the call would
return null). :discard_jobs_in_the_past ?

Would that suit you ? There's maybe a better name for that param.


Wdyt ?

-- 
John Mettraux   -///-   http://jmettraux.openwfe.org

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to