[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Timers, scheduling and Ruby

Lipper, Matthew

12/1/2006 8:23:00 PM

>
>
> here's what i'd like
>
>
> inclusive_endpoint = Time.now + 7.days
^^^^^^^^
is there already a library/utility for the above somewhere?

>
> runt.next_times inclusive_endpoint #=> array of all times
> covered between
> # now and endpoint,
> 'now' should be an
> # optional parameter
> so multiple calls
> # can be made
> transactional, eg
> #
> # runt.next_times
> inclusive_endpoint, 'now' => Time.now
> # runt.next_times
> inclusive_endpoint, :now => Time.now
> #
>
> that way it's easy to do
>
> loop{
> now = Time.now
>
> inclusive_endpoint = now + sleep_interval
>
> runts.each do |runt|
> times = runt.next_times inclusive_endpoint, :now => now
> schedule_all_events times
> end
>
> sleep_until inclusive_endpoint
> }
>
>
> make sense?

think so; will try to add this weekend. If I have questions may I
contact you offline? (I'm subscribed to CLR w/my work address -- cc'd
address above is perfect!)

>
> thanks for a great lib btw!
>

np, thanks for the kind words! ...anyway, Martin Fowler did all the hard
work by coming up with the pattern in the first place...


Have a nice weekend all!

Matt

__mlipper__at__gmail_dot_com__

1 Answer

Ara.T.Howard

12/1/2006 8:49:00 PM

0