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, #handle_error, #post_init, #post_process, #pre_process, #process, #receive_data, #remote_address, #terminate_request, #threaded?

Methods included from Logging

#debug, debug, debug?, #log, log, #log_error, log_error, #silent, #silent=, silent?, #trace, trace, trace?

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