On Fri, Apr 18, 2008 at 9:26 PM, sup <[EMAIL PROTECTED]> wrote:
>
>  Im using openWFE plugin for scheduling of jobs.
>  I want a function to be called after some time interval.

Hi Supriya,

The gem "openwferu-scheduler" got renamed "rufus-scheduler".

The homepage : http://rufus.rubyforge.org/rufus-scheduler
The source code : http://github.com/jmettraux/rufus-scheduler
The mailing list is at : http://groups.google.com/group/rufus-ruby


>  The code goes like this:
>    1. require 'openwfe/util/scheduler'
>    2. include OpenWFE
>    3.
>    4. scheduler = Scheduler.new
>    5. scheduler.start
>    6.
>    7. # Simple usage
>    8. scheduler.schedule_every('1s'){ p 'task'}
>    9.
>   10.
>   11. scheduler.join
>
>  This particular code takes only one line of task, how do i call a
>  method say "method1" in this code.

---8<---

require 'rubygems'
require 'rufus/scheduler'

s = Rufus::Scheduler.new
s.start

s.schedule_every '1s' { method1 } # calling "method1" without arguments

s.join

--->8---


>  Can anyone suggest me something over it / or is there any other
>  solution which can do this work in a better way. Please provide the
>  code!

You were talking about "executing some code after some time interval" :

---8<---

s.schedule_in "10m5s" do # do the job in 10 minutes and 5 secons
    puts "doing my job"
    puts "over..."
end

--->8---


Best regards,

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

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"OpenWFEru dev" 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-dev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to