Sha256: 8e7ffa89771806b5f517889f6945c2216b29f36d11c6613a4d62f303e0408cfb
Contents?: true
Size: 1.01 KB
Versions: 34
Compression:
Stored size: 1.01 KB
Contents
require 'concurrent/hash' require 'concurrent/array' require 'rom/memory/dataset' module ROM module Memory # In-memory thread-safe data storage # # @private class Storage # Dataset registry # # @return [ThreadSafe::Hash] # # @api private attr_reader :data # @api private def initialize @data = Concurrent::Hash.new end # @return [Dataset] # # @api private def [](name) data[name] end # Register a new dataset # # @return [Dataset] # # @api private def create_dataset(name) data[name] = Dataset.new(Concurrent::Array.new) end # Check if there's dataset under specified key # # @return [Boolean] # # @api private def key?(name) data.key?(name) end # Return registered datasets count # # @return [Integer] # # @api private def size data.size end end end end
Version data entries
34 entries across 34 versions & 2 rubygems