From: Eric Wong Date: 2011-12-08T09:18:26+09:00 Subject: [ANN] terrible_timeout 0.1.0 - an alternative to timeout 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#raise TerribleTimeout.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). * http://bogomips.org/terrible_timeout/ * terrible.timeout@librelist.org * git://bogomips.org/terrible_timeout.git * http://bogomips.org/terrible_timeout/NEWS.atom.xml * License: GPLv3 -- Eric Wong