Class: BetterThread

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/better_thread.rb

Instance Method Summary collapse

Constructor Details

#initialize(opts = {}, &block) ⇒ BetterThread

Returns a new instance of BetterThread.



10
11
12
13
14
15
# File 'lib/better_thread.rb', line 10

def initialize(opts = {}, &block)
  @timeout = false

  __better_thread_killer opts[:timeout] if opts[:timeout]
  @thread = ::Thread.send :new, &block
end

Instance Method Details

#timeout?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/better_thread.rb', line 17

def timeout?
  @timeout
end