Class: Nonnative::DelaySocketPair

Inherits:
SocketPair show all
Defined in:
lib/nonnative/delay_socket_pair.rb

Instance Method Summary collapse

Methods inherited from SocketPair

#connect, #initialize

Constructor Details

This class inherits a constructor from Nonnative::SocketPair

Instance Method Details

#read(socket) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/nonnative/delay_socket_pair.rb', line 5

def read(socket)
  Nonnative.logger.info "delaying socket '#{socket.inspect}' for 'delay' pair"

  duration = proxy.options[:delay] || 2
  sleep duration

  super
end