RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

TIMEx — a deadline engine for Ruby

Production timeouts are rarely “just call Timeout.timeout.” You need a real budget, predictable expiry, and a way to pass that budget to the next service. TIMEx is a small, stdlib-only gem that treats timeouts as deadlines: monotonic clocks, pluggable strategies, and one consistent API—no Rails, no ActiveSupport.

Use TIMEx.deadline for cooperative checks in your own code, or pick a strategy (:io, :wakeup, :unsafe, and others) when the runtime can enforce the cap for you. Need a soft landing? Return a TIMEx::Result instead of raising. Calling downstream? Encode the remaining budget in X-TIMEx-Deadline.

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in