Sha256: 645bd5958f49ae5ded5cf521d0caefa2f349e1261311bbc857b323bf248fd602

Contents?: true

Size: 351 Bytes

Versions: 7

Compression:

Stored size: 351 Bytes

Contents

# frozen_string_literal: true

module Facter
  class CacheManager
    @semaphore = Mutex.new
    @resolvers = []

    def self.subscribe(resolver)
      @semaphore.synchronize do
        @resolvers << resolver
      end
    end

    def self.invalidate_all_caches
      @resolvers.uniq.each(&:invalidate_cache)
      @resolvers = []
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
facter-4.0.13 lib/framework/core/cache_manager.rb
facter-4.0.12 lib/framework/core/cache_manager.rb
facter-4.0.11 lib/framework/core/cache_manager.rb
facter-4.0.10.pre lib/framework/core/cache_manager.rb
facter-4.0.9.pre lib/framework/core/cache_manager.rb
facter-4.0.8.pre lib/framework/core/cache_manager.rb
facter-4.0.7.pre lib/framework/core/cache_manager.rb