logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

Catmandu::Fix::Bind::timeout - run fixes that should run within a time limit

Configuration

timeout(time=>VALUE,units=>MICROSECOND|MILLISECONDS|SECONDS|MINUTES|HOURS)
       Set a timeout to VALUE. 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.

           # 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

       At timeout a log message of level WARN will be generated.

Description

       The timeout binder will run the supplied block only when all the fixes can be run within a time limit.
       All fixes (except side-effects) are ignored when the block can't be executed within the time limit.

Name

       Catmandu::Fix::Bind::timeout - run fixes that should run within a time limit

See Also

       Catmandu::Fix::Bind

perl v5.40.0                                       2025-01-17                  Catmandu::Fix::Bind::timeout(3pm)

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

See Also