Class: EmmyExtends::Thin::Backend
- Inherits:
-
Thin::Backends::Base
- Object
- Thin::Backends::Base
- EmmyExtends::Thin::Backend
- Defined in:
- lib/emmy_extends/thin/backend.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #connect ⇒ Object
-
#disconnect ⇒ Object
Stops the server.
-
#initialize(host, port, options) ⇒ Backend
constructor
A new instance of Backend.
- #initialize_connection(conn) ⇒ Object
- #start ⇒ Object
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(host, port, options) ⇒ Backend
Returns a new instance of Backend.
5 6 7 |
# File 'lib/emmy_extends/thin/backend.rb', line 5 def initialize(host, port, ) super() end |
Instance Attribute Details
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/emmy_extends/thin/backend.rb', line 3 def url @url end |
Instance Method Details
#connect ⇒ Object
9 10 11 |
# File 'lib/emmy_extends/thin/backend.rb', line 9 def connect raise "deprecated. you should start server through emmy.bind" end |
#disconnect ⇒ Object
Stops the server
18 19 20 21 |
# File 'lib/emmy_extends/thin/backend.rb', line 18 def disconnect #puts "disconnect" #EventMachine.stop_server(@signature) end |
#initialize_connection(conn) ⇒ Object
23 24 25 26 27 28 29 30 31 |
# File 'lib/emmy_extends/thin/backend.rb', line 23 def initialize_connection(conn) @stopping = false thin_connection = ::Thin::Connection.new(conn.signature) thin_connection.backend = self conn.delegate = thin_connection super(thin_connection) @running = true # FIXME: maybe not here conn.delegate.post_init end |
#start ⇒ Object
13 14 15 |
# File 'lib/emmy_extends/thin/backend.rb', line 13 def start raise "deprecated. you should start server through emmy.bind" end |
#to_a ⇒ Object
33 34 35 |
# File 'lib/emmy_extends/thin/backend.rb', line 33 def to_a [url, EmmyExtends::Thin::Connection, method(:initialize_connection)] end |
#to_s ⇒ Object
37 38 39 |
# File 'lib/emmy_extends/thin/backend.rb', line 37 def to_s "#{@host}:#{@port}" end |