Sha256: cd7752acc737aeb721003baa40e2f222c7c9dbd7c02fa22b3b4b6ff01d02bc49
Contents?: true
Size: 627 Bytes
Versions: 140
Compression:
Stored size: 627 Bytes
Contents
# frozen_string_literal: true module SplitIoClient module Helpers class ThreadHelper def self.stop(thread_sym, config) thread = config.threads[thread_sym] unless thread.nil? config.logger.debug("Stopping #{thread_sym} thread...") if config.debug_enabled sleep(0.1) while thread.status == 'run' Thread.kill(thread) end rescue StandardError => e config.logger.error(e.inspect) end def self.alive?(thread_sym, config) thread = config.threads[thread_sym] thread.nil? ? false : thread.alive? end end end end
Version data entries
140 entries across 140 versions & 1 rubygems