Class: Daemon::AllocateWorkers::WorkerIds
- Inherits:
-
Object
- Object
- Daemon::AllocateWorkers::WorkerIds
- Defined in:
- lib/onapp/engine/allocate_workers.rb
Overview
Used to generate unique ids for onappd instances
Instance Method Summary (collapse)
-
- (WorkerIds) initialize
constructor
A new instance of WorkerIds.
- - (Object) next
Constructor Details
- (WorkerIds) initialize
Returns a new instance of WorkerIds
11 12 13 |
# File 'lib/onapp/engine/allocate_workers.rb', line 11 def initialize @id = Daemon.another_instances_pids.count end |
Instance Method Details
- (Object) next
15 16 17 |
# File 'lib/onapp/engine/allocate_workers.rb', line 15 def next @id += 1 end |