Sha256: 33530778be03805238c8fbbf99fcc754fd58a35818a14cb309a3e92a3eeca073
Contents?: true
Size: 546 Bytes
Versions: 20
Compression:
Stored size: 546 Bytes
Contents
# frozen_string_literal: true class BatchLoader class Executor NAMESPACE = :batch_loader def self.ensure_current Thread.current[NAMESPACE] ||= new end def self.current Thread.current[NAMESPACE] end def self.clear_current Thread.current[NAMESPACE] = nil end attr_reader :items_by_block, :loaded_values_by_block def initialize @items_by_block = Hash.new { |hash, key| hash[key] = Set.new } @loaded_values_by_block = Hash.new { |hash, key| hash[key] = {} } end end end
Version data entries
20 entries across 20 versions & 1 rubygems