Sha256: 5db23c587e1e489b76ac6d096bd2e8edd7f1f730ef65ea1134909d7379ee74b0
Contents?: true
Size: 444 Bytes
Versions: 7
Compression:
Stored size: 444 Bytes
Contents
require "bench" require_relative "../lib/ohm" Ohm.redis = Redic.new("redis://127.0.0.1:6379/15") Ohm.flush class Event < Ohm::Model attribute :name attribute :location index :name index :location end class Sequence def initialize @value = 0 end def succ! Thread.exclusive { @value += 1 } end def self.[](name) @@sequences ||= Hash.new { |hash, key| hash[key] = Sequence.new } @@sequences[name] end end
Version data entries
7 entries across 7 versions & 2 rubygems