Class: BitClust::Server

Inherits:
Object show all
Defined in:
lib/bitclust/server.rb

Overview

Body of Refe server (spanwed by `refe –server`).

Instance Method Summary collapse

Constructor Details

#initialize(db) ⇒ Server

Returns a new instance of Server.


24
25
26
# File 'lib/bitclust/server.rb', line 24

def initialize(db)
  @db = db
end

Instance Method Details

#listen(url, foreground = false) ⇒ Object


28
29
30
31
32
# File 'lib/bitclust/server.rb', line 28

def listen(url, foreground = false)
  WEBrick::Daemon.start unless foreground
  DRb.start_service url, @db
  DRb.thread.join
end