Class: SidekiqGlass::Timeout
- Inherits:
-
Object
- Object
- SidekiqGlass::Timeout
- Defined in:
- lib/sidekiq_glass/timeout.rb
Overview
Timeout class
Defined Under Namespace
Classes: TimeoutError
Class Method Summary collapse
-
.perform(time, &block) ⇒ Object
Executed given method and raises exception if it takes to much time.
Class Method Details
.perform(time, &block) ⇒ Object
Executed given method and raises exception if it takes to much time
17 18 19 |
# File 'lib/sidekiq_glass/timeout.rb', line 17 def self.perform(time, &block) ::Timeout.timeout(time, TimeoutError) { block.call } end |