Sha256: 31a83e347c686574375100b37d04b8925b3a7ee13f4fa0bec95ef90983a21cf4

Contents?: true

Size: 1.18 KB

Versions: 1

Compression:

Stored size: 1.18 KB

Contents

# code:
# * George Moschovitis  <gm@navel.gr>
#
# (c) 2004 Navel, all rights reserved.
# $Id: server.rb 167 2004-11-23 14:03:10Z gmosx $

require "drb"

require "nitro/application"
require "nitro/server"
require "nitro/app/session"

module N; module App

# = ServerMixin
#
# Usefull application server related methods.
#
module ServerMixin

	def initialize_app
		if $drb_state
			# Cluster mode: use distributed Ruby objects.
			$lm = N::Cluster::Slm.new($drb_lm_server, "druby://:8000")
			$sessions = DRbObject.new(nil, $drb_sessions_cluster)
		else
			# NoCluster mode: use standard Ruby onjects.
			$lm = N::SafeHash.new
			$sessions = N::App::SessionManager.new
		end

		# initialize app
		initialize_sitemap()
		initialize_shaders()
		initialize_events()		
	end
	
end

# = Server
#
# The Application Server. Handles dynamic requests in a web application.
# Dont keepalive (or use a VERY SMALL keepalive). Typically this server
# is used along with a standars http server that handles other resources.
#
class Server < N::Server
	include N::App::ServerMixin
	
	def initialize(name = "AppServer")
		super
		initialize_app()
		
		Logger.info "Server listening at #$srv_url"
	end
end

end; end  # module

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
nitro-0.8.0 lib/nitro/server/server.rb