Class
Raised by Timeout.timeout
when the block times out.
Attributes
Read
No documentation available
Class Methods
lib/timeout.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/timeout.rb, line 32
def self.catch(*args)
exc = new(*args)
exc.instance_variable_set(:@thread, Thread.current)
exc.instance_variable_set(:@catch_value, exc)
::Kernel.catch(exc) {yield exc}
end
No documentation available
Instance Methods
lib/timeout.rb
View on GitHub
# File tmp/rubies/ruby-3.1.3/lib/timeout.rb, line 39
def exception(*)
# TODO: use Fiber.current to see if self can be thrown
if self.thread == Thread.current
bt = caller
begin
throw(@catch_value, bt)
rescue UncaughtThrowError
end
end
super
end
No documentation available