class Proxi::SlowDown
Wait before handing back data coming from the remote, this simulates a slow connection, and can be used to test timeouts.
Public Class Methods
new(wait_seconds: 5)
click to toggle source
# File lib/proxi/listeners.rb, line 42 def initialize(wait_seconds: 5) @wait_seconds = wait_seconds end
Public Instance Methods
new_connection(connection)
click to toggle source
# File lib/proxi/listeners.rb, line 46 def new_connection(connection) connection.on(:data_out) { sleep @wait_seconds } end