Module: TestProxyConnection::ProxyConnection

Defined in:
lib/ext/eventmachine-0.12.10/tests/test_proxy_connection.rb

Instance Method Summary collapse

Instance Method Details

#connection_completedObject



16
17
18
19
20
# File 'lib/ext/eventmachine-0.12.10/tests/test_proxy_connection.rb', line 16

def connection_completed
  EM.next_tick {
    send_data @request
  }
end

#initialize(client, request) ⇒ Object



8
9
10
# File 'lib/ext/eventmachine-0.12.10/tests/test_proxy_connection.rb', line 8

def initialize(client, request)
  @client, @request = client, request
end

#post_initObject



12
13
14
# File 'lib/ext/eventmachine-0.12.10/tests/test_proxy_connection.rb', line 12

def post_init
  EM::enable_proxy(self, @client)
end

#proxy_target_unboundObject



22
23
24
25
# File 'lib/ext/eventmachine-0.12.10/tests/test_proxy_connection.rb', line 22

def proxy_target_unbound
  $unbound_early = true
  EM.stop
end

#unbindObject



27
28
29
# File 'lib/ext/eventmachine-0.12.10/tests/test_proxy_connection.rb', line 27

def unbind
  @client.close_connection_after_writing
end