Module: EventMachine::WebSocket

Defined in:
lib/diamond/osc.rb

Class Method Summary collapse

Class Method Details

.run(options) ⇒ Object



95
96
97
98
99
100
# File 'lib/diamond/osc.rb', line 95

def self.run(options)
  host, port = options.values_at(:host, :port)
  EM.start_server(host, port, Connection, options) do |c|
    yield c
  end
end

.start(options, &blk) ⇒ Object



85
86
87
88
89
90
91
92
93
# File 'lib/diamond/osc.rb', line 85

def self.start(options, &blk)
  #EM.epoll
  #EM.run {
    trap("TERM") { stop }
    trap("INT")  { stop }

    run(options, &blk)
  #}
end