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-1.1.0 lib/right_chimp/IDManager.rb
right_chimp-1.0.9 lib/right_chimp/IDManager.rb
right_chimp-1.0.8 lib/right_chimp/IDManager.rb
right_chimp-1.0.7 lib/right_chimp/IDManager.rb
right_chimp-1.0.3 lib/right_chimp/IDManager.rb
right_chimp-1.0.2 lib/right_chimp/IDManager.rb
right_chimp-1.0.1 lib/right_chimp/IDManager.rb
right_chimp-1.0 lib/right_chimp/IDManager.rb