Class: SimplePubSub::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/simplepubsub.rb

Defined Under Namespace

Classes: PubSub

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname) ⇒ Client

generally used by the web server



54
55
56
57
58
59
# File 'lib/simplepubsub.rb', line 54

def initialize(hostname)
  
  DRb.start_service
  # attach to the DRb server via a URI given on the command line
  @remote_obj = DRbObject.new nil, "druby://#{hostname}:59000"      
end

Instance Attribute Details

#remote_objObject (readonly)

Returns the value of attribute remote_obj.



50
51
52
# File 'lib/simplepubsub.rb', line 50

def remote_obj
  @remote_obj
end

Class Method Details

.connect(base_url) {|PubSub.new base_url| ... } ⇒ Object

Yields:



61
62
63
# File 'lib/simplepubsub.rb', line 61

def self.connect(base_url)
  yield(PubSub.new base_url)
end