Method: Pregel::Worker#initialize

Defined in:
lib/pregel/worker.rb

#initialize(graph = []) ⇒ Worker

Returns a new instance of Worker.



5
6
7
8
9
# File 'lib/pregel/worker.rb', line 5

def initialize(graph = [])
  raise 'empty worker graph' if graph.empty?
  @vertices = graph
  @active   = graph.size
end