Module: EventMachine::WebSocket
- Defined in:
- lib/em-websocket/websocket.rb,
lib/em-websocket/connection.rb
Defined Under Namespace
Classes: Connection
Class Method Summary collapse
Class Method Details
.start(options, &blk) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/em-websocket/websocket.rb', line 4 def self.start(, &blk) EM.epoll EM.run do trap("TERM") { stop } trap("INT") { stop } EventMachine::start_server([:host], [:port], EventMachine::WebSocket::Connection, ) do |c| blk.call(c) end end end |
.stop ⇒ Object
18 19 20 21 |
# File 'lib/em-websocket/websocket.rb', line 18 def self.stop puts "Terminating WebSocket Server" EventMachine.stop end |