Class: Rinda::RingProvider
Relationships & Source Files | |
Inherits: | Object |
Defined in: | lib/rinda/ring.rb |
Overview
RingProvider
uses a RingServer advertised TupleSpace as a name service. TupleSpace clients can register themselves with the remote TupleSpace and look up other provided services via the remote TupleSpace.
Services are registered with a tuple of the format [:name, klass, DRbObject, description].
Class Method Summary
-
.new(klass, front, desc, renewer = nil) ⇒ RingProvider
constructor
Creates a
RingProvider
that will provide aklass
service running onfront
, with adescription
.
Instance Method Summary
-
#provide
Advertises this service on the primary remote TupleSpace.
Constructor Details
.new(klass, front, desc, renewer = nil) ⇒ RingProvider
Creates a RingProvider
that will provide a klass
service running on front
, with a description
. renewer
is optional.
# File 'lib/rinda/ring.rb', line 469
def initialize(klass, front, desc, renewer = nil) @tuple = [:name, klass, front, desc] @renewer = renewer || Rinda::SimpleRenewer.new end
Instance Method Details
#provide
Advertises this service on the primary remote TupleSpace.
# File 'lib/rinda/ring.rb', line 477
def provide ts = Rinda::RingFinger.primary ts.write(@tuple, @renewer) end