Catman...imeout(3pm)
π Catman...imeout(3pm) π
okay bestie, so this is Catmandu::Fix::Bind::timeout, and it lives in the User Contributed Perl Documentation section (that's the 3pm part, iykyk) β¨
πΈ NAME πΈ
Catmandu::Fix::Bind::timeout β it runs fixes that should run within a time limit, no cap π
π SYNOPSIS π
# The following bind will run fix1(), fix2(), ... fixN() only if the
# action can be done in 5 seconds
do timeout(time:5, units:seconds)
fix1()
fix2()
fix3()
.
.
.
fixN()
end
next_fix()
like literally just wrap your little fix squad in a do timeout(...) block and they only get to do their thing if they can do it inside the clock β³π
π¦ DESCRIPTION π¦
The timeout binder will run the supplied block only when all the fixes can be run within a time limit. That's the whole vibe, fr fr.
And the part that's giving very much important: all fixes (except side-effects) are ignored when the block can't be executed within the time limit. ignored. gone. not happening. π
β¨ CONFIGURATION β¨
β timeout(time => VALUE , units => MICROSECOND|MILLISECONDS|SECONDS|MINUTES|HOURS)
Set a timeout to VALUE.
listen up bestie, this is the key detail: this timeout doesn't prevent a fix script to run longer than the specified value β but it does prevent fixes to have any effect when the timeout has been reached. two very different things, don't mix them up π
# This script will run 10 seconds
do timeout(time:5, units:seconds)
add_field(foo,ok) # This will be ignored
sleep(10,seconds)
set_field(foo,error) # This will be ignored
end
see how it still runs the full 10 seconds?? but those add_field and set_field calls get straight up ignored because the 5 second timeout already hit. the script keeps going, the effects do not. that's the whole point, iconic behavior honestly π
At timeout a log message of level WARN will be generated. so you'll get a lil heads up in your logs, you won't be left guessing π«Ά
π SEE ALSO π
Catmandu::Fix::Bindβ the parent bind situation, go read it too bestie
that's the whole page, periodt π
oh and before I forget β this was put together with perl v5.40.1, dated 2026-01-24, and it's the Catman...imeout(3pm) page from the User Contributed Perl Documentation crew. love that for us, mwah ππ
π¦ where this page comes from
- ubuntu resolute: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libcatmandu-perl 1.2025-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms