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

Version Path
splitclient-rb-7.3.3.pre.rc9-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc9 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc8-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc8 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc7-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc7 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc6-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc6 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc5-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc5 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc4-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc4 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc3-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc3 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc2-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc2 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc1-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.3.pre.rc1 lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.2-java lib/splitclient-rb/helpers/thread_helper.rb
splitclient-rb-7.3.2 lib/splitclient-rb/helpers/thread_helper.rb