Class: Compp::Connection

Inherits:
EM::Connection
  • Object
show all
Includes:
EventMachine::HttpServer
Defined in:
lib/compp/connection.rb

Direct Known Subclasses

Default, Sprinkler

Instance Method Summary collapse

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_requestObject

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