Sha256: c3835eff5d2b655838843426f3119fa17a567ea0c96139483fbccc9aeeb47053

Contents?: true

Size: 482 Bytes

Versions: 2

Compression:

Stored size: 482 Bytes

Contents

class ProxyMachine
  class WarningServerConnection < ServerConnection
    
    def initialize(conn)
      @warning_timeout = conn.inactivity_warning_timeout
      @warning_callback = conn.inactivity_warning_triggered
      super(conn)
    end
    
    def post_init
      if @warning_timeout
        @timer = EventMachine::Timer.new(@warning_timeout, &@warning_callback) 
      end
      super
    end
    
    def unbind
      @timer && @timer.cancel
      super
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
fizx-proxymachine-1.8.0 lib/proxymachine/warning_server_connection.rb
fizx-proxymachine-1.7.1 lib/proxymachine/warning_server_connection.rb