Sha256: cc6882927a92de32d1301c6ff61aec4cc97de0bd6aed48d56a02d65c13a056ab

Contents?: true

Size: 299 Bytes

Versions: 14

Compression:

Stored size: 299 Bytes

Contents

require 'set'

class TraceTree
  module Warm

    Warmed = Set.new
    Lock = Mutex.new

    class << self
      def check_and_warm key
        Lock.synchronize do
          warmed = Warmed.include? key
          Warmed << key unless warmed
          warmed
        end
      end
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
trace_tree-0.3.6 lib/trace_tree/warm.rb
trace_tree-0.3.5 lib/trace_tree/warm.rb
trace_tree-0.3.4 lib/trace_tree/warm.rb
trace_tree-0.3.3 lib/trace_tree/warm.rb
trace_tree-0.3.2 lib/trace_tree/warm.rb
trace_tree-0.3.1 lib/trace_tree/warm.rb
trace_tree-0.3.0 lib/trace_tree/warm.rb
trace_tree-0.2.23 lib/trace_tree/warm.rb
trace_tree-0.2.22 lib/trace_tree/warm.rb
trace_tree-0.2.21 lib/trace_tree/warm.rb
trace_tree-0.2.20 lib/trace_tree/warm.rb
trace_tree-0.2.19 lib/trace_tree/warm.rb
trace_tree-0.2.18 lib/trace_tree/warm.rb
trace_tree-0.2.17 lib/trace_tree/warm.rb