403Webshell
Server IP : 74.208.236.108  /  Your IP : 216.73.216.214
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : u90537543 ( 11015977)
PHP Version : 8.2.32
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/lib/ruby/vendor_ruby/em/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/lib/ruby/vendor_ruby/em/timers.rb
module EventMachine
  # Creates a one-time timer
  #
  #  timer = EventMachine::Timer.new(5) do
  #    # this will never fire because we cancel it
  #  end
  #  timer.cancel
  #
  class Timer
    # Create a new timer that fires after a given number of seconds
    def initialize interval, callback=nil, &block
      @signature = EventMachine::add_timer(interval, callback || block)
    end

    # Cancel the timer
    def cancel
      EventMachine.send :cancel_timer, @signature
    end
  end

  # Creates a periodic timer
  #
  # @example
  #  n = 0
  #  timer = EventMachine::PeriodicTimer.new(5) do
  #    puts "the time is #{Time.now}"
  #    timer.cancel if (n+=1) > 5
  #  end
  #
  class PeriodicTimer
    # Create a new periodic timer that executes every interval seconds
    def initialize interval, callback=nil, &block
      @interval = interval
      @code = callback || block
      @cancelled = false
      @work = method(:fire)
      schedule
    end

    # Cancel the periodic timer
    def cancel
      @cancelled = true
    end

    # Fire the timer every interval seconds
    attr_accessor :interval

    # @private
    def schedule
      EventMachine::add_timer @interval, @work
    end

    # @private
    def fire
      unless @cancelled
        @code.call
        schedule
      end
    end
  end
end

Youez - 2016 - github.com/yon3zu
LinuXploit