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 20 21 |
# 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 = [] @pending_pings = [] @mutex = Mutex.new end |
Instance Method Details
#run ⇒ Object
Run reading and sending frames
24 25 26 27 28 |
# File 'lib/web_socket_rb/protocol/frames_handler.rb', line 24 def run @threads << Thread.new { verify_status } @threads << Thread.new { process_incoming_frames } @threads.each(&:join) end |