Class: Compp::Connection
- Inherits:
-
EM::Connection
- Object
- EM::Connection
- Compp::Connection
- Includes:
- EventMachine::HttpServer
- Defined in:
- lib/compp/connection.rb
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Connection
constructor
Initialize a new Compp:Connection.
-
#orbitize(obj) ⇒ Object
Sends obj.to_str on the comet connection!.
-
#process_http_request ⇒ Object
This is called upon new connection by an external client.
Constructor Details
#initialize(opts = {}) ⇒ Connection
Initialize a new Compp:Connection
7 8 |
# File 'lib/compp/connection.rb', line 7 def initialize(opts = {}) end |
Instance Method Details
#orbitize(obj) ⇒ Object
Sends obj.to_str on the comet connection!
12 13 14 |
# File 'lib/compp/connection.rb', line 12 def orbitize(obj) send_data(obj.to_str + "\r\n") end |
#process_http_request ⇒ Object
This is called upon new connection by an external client.
18 19 20 |
# File 'lib/compp/connection.rb', line 18 def process_http_request # Does nothing, this should be overriden if you want more advanced behavior end |