class JoobQ::Timeout

Defined in:

joobq/timeout.cr

Class Method Summary

Class Method Detail

def self.run(timeout : Time::Span, &block : -> ) #

Executes the given block with a timeout. If the block takes longer than the specified timeout (in seconds) to complete, it raises a Timeout::TimeoutError.

@param timeout [Int32] the maximum duration in seconds that the block is allowed to run @yield the block of code to execute with a timeout @raise Timeout::TimeoutError if the block exceeds the specified timeout


[View source]