Class: N::Cluster

Inherits:
Application
  • Object
show all
Defined in:
lib/nitro/cluster.rb

Overview

A Cluster manages the state of a collection of servers. The cluster synchronizes the servers and distributes the state. An older version used a polling system, ie: the servers polled the cluster to obtain the state. This version uses a push system, ie when the state is changed a delta is pushed to the clients.

TODO: use Sync instead of Monitor

Defined Under Namespace

Classes: CHash, Clm, SHash, Slm

Instance Method Summary collapse

Constructor Details

#initialize(name = "Cluster") ⇒ Cluster

Returns a new instance of Cluster.



196
197
198
# File 'lib/nitro/cluster.rb', line 196

def initialize(name = "Cluster")
	super
end

Instance Method Details

#runObject



200
201
202
203
204
205
206
207
208
209
# File 'lib/nitro/cluster.rb', line 200

def run
	N::Cluster::Clm.new
	DRb.start_service("druby://:8001", N::SessionManager.new)

	while true
		sleep(5000)
	end
	
	super
end