Class: N::Cluster

Inherits:
Application show all
Defined in:
lib/n/app/cluster.rb

Overview

Cluster

A Cluster is 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.

Defined Under Namespace

Classes: CHash, Clm, SHash, Slm

Instance Attribute Summary

Attributes inherited from Application

#create_time, #daemonized, #description, #name, #pid, #pidfile, #status, #title, #version

Instance Method Summary collapse

Methods inherited from Application

#daemon_pid, #daemonize, #parse_arguments, #restart, #start, #stop

Constructor Details

#initialize(name = "Cluster") ⇒ Cluster

Returns a new instance of Cluster.



196
197
198
# File 'lib/n/app/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/n/app/cluster.rb', line 200

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

	while true
		sleep(5000)
	end
	
	super
end