Module: XRBP::ThreadRegistry
- Included in:
- WebClient::Connection, WebSocket::Connection
- Defined in:
- lib/xrbp/thread_registry.rb
Overview
Helper mixin providing internal thread management.
Instance Method Summary collapse
Instance Method Details
#rsleep(t) ⇒ Object
12 13 14 15 16 |
# File 'lib/xrbp/thread_registry.rb', line 12 def rsleep(t) thread_registry << Thread.current sleep(t) thread_registry.delete(Thread.current) end |
#thread_registry ⇒ Object
8 9 10 |
# File 'lib/xrbp/thread_registry.rb', line 8 def thread_registry @thread_registry ||= Concurrent::Array.new end |
#wake_all ⇒ Object
18 19 20 |
# File 'lib/xrbp/thread_registry.rb', line 18 def wake_all thread_registry.each { |th| th.wakeup } end |