Class: Thin::Backends::TcpServerWithCallbacks

Inherits:
TcpServer
  • Object
show all
Defined in:
lib/thin/backends/tcp_server_with_callbacks.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port, options) ⇒ TcpServerWithCallbacks

Returns a new instance of TcpServerWithCallbacks.



4
5
6
# File 'lib/thin/backends/tcp_server_with_callbacks.rb', line 4

def initialize(host, port, options)
  super(host, port)
end

Instance Method Details

#connectObject



8
9
10
11
# File 'lib/thin/backends/tcp_server_with_callbacks.rb', line 8

def connect
  super
  Thin::Callbacks.after_connect_callbacks.each { |callback| callback.call }
end

#disconnectObject



13
14
15
16
# File 'lib/thin/backends/tcp_server_with_callbacks.rb', line 13

def disconnect
  Thin::Callbacks.before_disconnect_callbacks.each { |callback| callback.call }
  super
end