Sha256: 937ab5e9be512b990fcb588db876a67c865468a4dfe182466d5751c4c37c0a39
Contents?: true
Size: 722 Bytes
Versions: 10
Compression:
Stored size: 722 Bytes
Contents
# frozen_string_literal: true module Boppers class Runner def boppers Boppers.configuration.boppers end def run_bopper(bopper) interval = if bopper.respond_to?(:interval) bopper.interval else 60 end Thread.new do loop do begin bopper.call rescue StandardError => error Boppers.configuration.handle_exception&.call(error) end sleep interval end end end def call threads = boppers.each_with_object([]) do |bopper, buffer| buffer << run_bopper(bopper) end threads.each(&:join) end end end
Version data entries
10 entries across 10 versions & 1 rubygems