Class: Push::Transport::Controller::WebSocket
- Inherits:
-
Cramp::Websocket
- Object
- Cramp::Websocket
- Push::Transport::Controller::WebSocket
- Includes:
- Logger
- Defined in:
- lib/push/transport/controller/web_socket.rb
Instance Method Summary collapse
Instance Method Details
#bind_queue ⇒ Object
9 10 11 12 13 14 15 16 |
# File 'lib/push/transport/controller/web_socket.rb', line 9 def bind_queue logger.info "Subscribed to '#{exchange}'" queue.bind(channel.fanout(exchange)).subscribe(:ack => true) {|header, | header.ack render logger.info "Sent message: #{}" } end |
#message_received(data) ⇒ Object
25 26 27 |
# File 'lib/push/transport/controller/web_socket.rb', line 25 def (data) logger.info "Received #{data}" # Who cares? Do nothing. end |
#unbind_queue ⇒ Object
18 19 20 21 22 23 |
# File 'lib/push/transport/controller/web_socket.rb', line 18 def unbind_queue queue.unsubscribe { channel.close logger.info "Unsubscribed from '#{exchange}'" } end |