Sha256: a33778c61f67755c9e2025d75a72bce77575883f3755a59827675973f5d88f49

Contents?: true

Size: 271 Bytes

Versions: 48

Compression:

Stored size: 271 Bytes

Contents

#
# Utility class for generating sequential job ids
#
module Chimp
  class IDManager
    @@id = 0
    @@mutex = Mutex.new
    
    def self.get
      r = nil
      @@mutex.synchronize do
        @@id = @@id + 1
        r = @@id
      end
      return r
    end
  end
end

Version data entries

48 entries across 48 versions & 1 rubygems

Version Path
right_chimp-2.1.17 lib/right_chimp/IDManager.rb
right_chimp-2.1.15 lib/right_chimp/IDManager.rb
right_chimp-2.1.14 lib/right_chimp/IDManager.rb
right_chimp-2.1.13 lib/right_chimp/IDManager.rb
right_chimp-2.1.12 lib/right_chimp/IDManager.rb
right_chimp-2.1.10 lib/right_chimp/IDManager.rb
right_chimp-2.1.8 lib/right_chimp/IDManager.rb
right_chimp-2.1.7 lib/right_chimp/IDManager.rb
right_chimp-2.1.6 lib/right_chimp/IDManager.rb
right_chimp-2.1.5 lib/right_chimp/IDManager.rb
right_chimp-2.1.4 lib/right_chimp/IDManager.rb
right_chimp-2.1.3 lib/right_chimp/IDManager.rb
right_chimp-2.1.2 lib/right_chimp/IDManager.rb
right_chimp-2.1.0 lib/right_chimp/IDManager.rb
right_chimp-2.0.2 lib/right_chimp/IDManager.rb
right_chimp-2.0.1 lib/right_chimp/IDManager.rb
right_chimp-2.0 lib/right_chimp/IDManager.rb
right_chimp-1.1.3 lib/right_chimp/IDManager.rb
right_chimp-1.1.2 lib/right_chimp/IDManager.rb
right_chimp-1.1.1 lib/right_chimp/IDManager.rb