Methods

TerribleTimeout

License: GPLv3

This is extracted from the Rainbows::ThreadTimeout middleware distributed with Rainbows! This is INCOMPATIBLE with Rainbows::ThreadTimeout

It behaves like Timeout.timeout in the Ruby standard library, but:

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).

Public Class Methods

run(maxtime) view method source

Runs the specified block of code and (hopefully) have it terminate before maxtime

See TerribleTimeout for an example of how to use this

Originally generated with the Darkfish Rdoc Generator 2, modified by wrongdoc.

We love to hear from you!
Email patches (with git send-email), pull requests, questions, bug reports, suggestions, etc. to us publically at terrible.timeout@librelist.org.
To subscribe, just send any email to terrible.timeout@librelist.org, and respond to the automated confirmation message.
Do not waste bandwidth with HTML, HTML mail will not be read.
Quote only parts you're responding to and do not top post.
For sensitive topics, email us privately at normalperson@yhbt.net.