Class: Thin::SwiftiplyConnection

Inherits:
Connection
  • Object
show all
Defined in:
lib/thin/backends/swiftiply_client.rb

Constant Summary

Constants inherited from Connection

Connection::AsyncResponse

Instance Attribute Summary

Attributes inherited from Connection

#app, #backend, #request, #response, #threaded

Instance Method Summary collapse

Methods inherited from Connection

#can_persist!, #can_persist?, #close_request_response, #idle?, #post_init, #post_process, #pre_process, #process, #receive_data, #remote_address, #ssl_verify_peer, #terminate_request, #threaded?, #unexpected_error

Methods included from Logging

debug=, debug?, level, level=, #log, log_debug, #log_debug, log_error, #log_error, #log_info, log_info, log_msg, #silent, #silent=, silent=, silent?, #trace, trace, trace=, trace?, trace_msg

Instance Method Details

#connection_completedObject



33
34
35
# File 'lib/thin/backends/swiftiply_client.rb', line 33

def connection_completed
  send_data swiftiply_handshake(@backend.key)
end

#persistent?Boolean

Returns:

  • (Boolean)


37
38
39
# File 'lib/thin/backends/swiftiply_client.rb', line 37

def persistent?
  true
end

#unbindObject



41
42
43
44
# File 'lib/thin/backends/swiftiply_client.rb', line 41

def unbind
  super
  EventMachine.add_timer(rand(2)) { reconnect(@backend.host, @backend.port) } if @backend.running?
end