This module still sucks, don’t use it without knowing its caveats. Read
the RDoc, source code and code comments to understand it. Do not use
this module without reading, reviewing, and understanding it completely.
This is extracted from the Rainbows::ThreadTimeout middleware
distributed with {Rainbows!}[http://rainbows.rubyforge.org/]
This is INCOMPATIBLE with Rainbows::ThreadTimeout
It behaves like Timeout.timeout in the Ruby standard library, but:
-
does not support nesting timeouts
-
only spawns one Thread per-process instead of one thread per-timeout
-
is explicitly incompatible with anything that else that uses
Thread#raiseTerribleTimeout.run(666) do
puts “HELLO WORLD”
end
You should read and understand all the code and all the caveats of this
module before using it.
== Caveats
Badly-written C extensions may not be timed out. Audit and fix
(or remove) those extensions before relying on this module.
Do NOT assume “ensure” clauses will fire properly
Do NOT mix this with an existing Timeout.timeout block
Do NOT use Rainbows::ThreadTimeout with this
Do NOT nest invocations of this.
This will behave badly if system time is changed since Ruby
does not expose a monotonic clock for users, so don’t change
the system time while this is running. All servers should be
running ntpd anyways.
You probably shouldn’t use this (nor Timeout, nor
Rainbows::ThreadTimeout).
- File: README [terrible_timeout - an alternative to Timeout.timeout]
- [email protected]
- git://bogomips.org/terrible_timeout.git
- terrible_timeout news
- License: GPLv3