Class: Puma::ThreadPool::ProcessorThread
| Relationships & Source Files | |
| Inherits: | Object |
| Defined in: | lib/puma/thread_pool.rb |
Class Method Summary
- .new(pool) ⇒ ProcessorThread constructor
Instance Attribute Summary
- #alive? ⇒ Boolean readonly
- #marked_as_io_thread=(value) rw
- #marked_as_io_thread? ⇒ Boolean rw
- #thread rw
Instance Method Summary
Constructor Details
.new(pool) ⇒ ProcessorThread
# File 'lib/puma/thread_pool.rb', line 32
def initialize(pool) @pool = pool @thread = nil @marked_as_io_thread = false end
Instance Attribute Details
#alive? ⇒ Boolean (readonly)
[ GitHub ]
# File 'lib/puma/thread_pool.rb', line 52
def alive? @thread&.alive? end
#marked_as_io_thread=(value) (rw)
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 30
attr_writer :marked_as_io_thread
#marked_as_io_thread? ⇒ Boolean (rw)
[ GitHub ]
# File 'lib/puma/thread_pool.rb', line 48
def marked_as_io_thread? @marked_as_io_thread end
#thread (rw)
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 29
attr_accessor :thread
Instance Method Details
#[](key)
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 64
def [](key) @thread[key] end
#join
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 56
def join(...) @thread.join(...) end
#kill
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 60
def kill(...) @thread.kill(...) end
#mark_as_io_thread!
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 38
def mark_as_io_thread! unless @marked_as_io_thread @marked_as_io_thread = true # Immediately signal the pool that it can spawn a new thread # if there's some work in the queue. @pool.spawn_thread_if_needed end end
#raise
[ GitHub ]# File 'lib/puma/thread_pool.rb', line 68
def raise(...) @thread.raise(...) end