class JoobQ::Timeout
- JoobQ::Timeout
- Reference
- Object
Defined in:
joobq/timeout.crClass Method Summary
-
.run(timeout : Time::Span, &block : -> )
Executes the given block with a timeout.
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