Module: Poseidon::Cluster

Defined in:
lib/poseidon/cluster.rb

Constant Summary collapse

MAX_INT32 =
0x7fffffff
@@sem =
Mutex.new
@@inc =
0

Class Method Summary collapse

Class Method Details

.inc!Integer

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns an incremented number.



14
15
16
# File 'lib/poseidon/cluster.rb', line 14

def self.inc!
  @@sem.synchronize { @@inc += 1; @@inc = 1 if @@inc > MAX_INT32; @@inc }
end