class Sample

Attributes

am[R]

Public Class Methods

new() click to toggle source
# File lib/ActionManager.rb, line 227
        def initialize
            @am = ActionManager.new(15,true)

            @am.register_action(:SLEEP,method("sleep_action"))
#            @am.register_action(:SLEEP,Proc.new{|s,i| p s ; sleep(s)})
            @am.register_action(:NOP,method("nop_action"))

            def @am.get_runable_action
                action = super
                puts "getting: #{action.inspect}"
                action
            end

            def @am.delete_running_action(action_id)
                puts "deleting: #{action_id}"
                super(action_id)
            end
       end

Public Instance Methods

nop_action() click to toggle source
# File lib/ActionManager.rb, line 252
def nop_action
    p " - Just an action"
end
sleep_action(secs, id) click to toggle source
# File lib/ActionManager.rb, line 246
def sleep_action(secs, id)
    p "ID: #{id} sleeping #{secs} seconds"
    sleep(secs)
    p "ID: #{id} Awaken!"
end