Class: ActionCable::Connection::FayeClientSocket
- Inherits:
-
Object
- Object
- ActionCable::Connection::FayeClientSocket
- Defined in:
- lib/action_cable/connection/faye_client_socket.rb
Instance Method Summary collapse
- #alive? ⇒ Boolean
- #close ⇒ Object
-
#initialize(env, event_target, stream_event_loop, protocols) ⇒ FayeClientSocket
constructor
A new instance of FayeClientSocket.
- #protocol ⇒ Object
- #rack_response ⇒ Object
- #transmit(data) ⇒ Object
Constructor Details
#initialize(env, event_target, stream_event_loop, protocols) ⇒ FayeClientSocket
Returns a new instance of FayeClientSocket.
6 7 8 9 10 11 12 |
# File 'lib/action_cable/connection/faye_client_socket.rb', line 6 def initialize(env, event_target, stream_event_loop, protocols) @env = env @event_target = event_target @protocols = protocols @faye = nil end |
Instance Method Details
#alive? ⇒ Boolean
14 15 16 |
# File 'lib/action_cable/connection/faye_client_socket.rb', line 14 def alive? @faye && @faye.ready_state == Faye::WebSocket::API::OPEN end |
#close ⇒ Object
23 24 25 |
# File 'lib/action_cable/connection/faye_client_socket.rb', line 23 def close @faye && @faye.close end |
#protocol ⇒ Object
27 28 29 |
# File 'lib/action_cable/connection/faye_client_socket.rb', line 27 def protocol @faye && @faye.protocol end |
#rack_response ⇒ Object
31 32 33 34 |
# File 'lib/action_cable/connection/faye_client_socket.rb', line 31 def rack_response connect @faye.rack_response end |
#transmit(data) ⇒ Object
18 19 20 21 |
# File 'lib/action_cable/connection/faye_client_socket.rb', line 18 def transmit(data) connect @faye.send data end |