Thanks John. Most helpful as always.
I think I can take it from here now. Kumar On Jun 4, 11:57 pm, "John Mettraux" <[EMAIL PROTECTED]> wrote: > Hello Kumar, > > OK, I think I understand now. > > What about something like : > > ---8<--- > > require 'rubygems' > > require 'snmp' > require 'rufus/scheduler' > > A = ... > B = ... > > scheduler = Rufus::Scheduler.new > scheduler.start > > class Occurence > > def initialize > @timeout_job_id = scheduler.schedule_in "40s" do > run_other_script # "else" script > end > end > > def on_b > scheduler.cancel_job @timeout_job_id > run_script # "regular" script > end > end > > occurence = nil > > m = SNMP::TrapListener.new do |m| > m.on_trap(A) do |t| > occurence = Occurence.new > end > m.on_trap(B) do |t| > occurence.on_b > end > end > > m.join > > --->8--- > > But, this is not tested at all, and there are some corner cases not > covered, it's just like pseudo-code... > > I hope this helps anyway. Best regards, > > -- > John Mettraux -http://jmettraux.wordpress.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
