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.4 lib/right_chimp/id_manager.rb
right_chimp-2.3.2 lib/right_chimp/id_manager.rb
right_chimp-2.3.1 lib/right_chimp/id_manager.rb
right_chimp-2.3 lib/right_chimp/id_manager.rb
right_chimp-2.2.2 lib/right_chimp/id_manager.rb
right_chimp-2.2.1 lib/right_chimp/id_manager.rb
right_chimp-2.2 lib/right_chimp/id_manager.rb
right_chimp-2.1.28 lib/right_chimp/IDManager.rb
right_chimp-2.1.27 lib/right_chimp/IDManager.rb
right_chimp-2.1.26 lib/right_chimp/IDManager.rb
right_chimp-2.1.25.2 lib/right_chimp/IDManager.rb
right_chimp-2.1.25 lib/right_chimp/IDManager.rb
right_chimp-2.1.24 lib/right_chimp/IDManager.rb
right_chimp-2.1.22.2 lib/right_chimp/IDManager.rb
right_chimp-2.1.22.1 lib/right_chimp/IDManager.rb
right_chimp-2.1.22 lib/right_chimp/IDManager.rb
right_chimp-2.1.21 lib/right_chimp/IDManager.rb
right_chimp-2.1.19.1 lib/right_chimp/IDManager.rb
right_chimp-2.1.19 lib/right_chimp/IDManager.rb
right_chimp-2.1.18 lib/right_chimp/IDManager.rb