Method: Tpool.current_block

Defined in:
lib/tpool.rb

.current_block(thread = Thread.current) ⇒ Object

Returns the ‘Tpool::Block’ that is running in the given thread.



15
16
17
18
# File 'lib/tpool.rb', line 15

def self.current_block(thread = Thread.current)
  return thread[:tpool][:block] if thread[:tpool].is_a?(Hash)
  raise "No block was found running in that thread."
end