Class: WebSocketRb::Protocol::FramesHandler
- Inherits:
-
Object
- Object
- WebSocketRb::Protocol::FramesHandler
- Defined in:
- lib/web_socket_rb/protocol/frames_handler.rb
Instance Method Summary collapse
-
#initialize(connections, connection, routes, frames_sender, sandbox) ⇒ FramesHandler
constructor
A new instance of FramesHandler.
-
#run ⇒ Object
Run reading and sending frames.
Constructor Details
#initialize(connections, connection, routes, frames_sender, sandbox) ⇒ FramesHandler
Returns a new instance of FramesHandler.
12 13 14 15 16 17 18 19 |
# File 'lib/web_socket_rb/protocol/frames_handler.rb', line 12 def initialize(connections, connection, routes, frames_sender, sandbox) @connections = connections @conn = connection @routes = routes @frames_sender = frames_sender @sandbox = sandbox @threads = [] end |
Instance Method Details
#run ⇒ Object
Run reading and sending frames
22 23 24 25 26 |
# File 'lib/web_socket_rb/protocol/frames_handler.rb', line 22 def run @threads << Thread.new { verify_status } @threads << Thread.new { process_incoming_frames } @threads.each(&:join) end |