Sha256: e7f5639e95288391b2d5724ff34036f93ee3cd82d91c1921479567b2652e5a2e

Contents?: true

Size: 394 Bytes

Versions: 1

Compression:

Stored size: 394 Bytes

Contents

# frozen_string_literal: true

module SlowEnumeratorTools
  module Util
    STOP_OK = Object.new
    STOP_ERR = Object.new

    def self.gen_collector_thread(enum, queue)
      Thread.new do
        begin
          enum.each { |e| queue << e }
          queue << STOP_OK
        rescue StandardError => e
          queue << STOP_ERR
          queue << e
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
slow_enumerator_tools-1.1.0 lib/slow_enumerator_tools/util.rb