Class: Rinda::RingProvider
- Inherits:
-
Object
- Object
- Rinda::RingProvider
- 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].
Instance Method Summary collapse
-
#initialize(klass, front, desc, renewer = nil) ⇒ RingProvider
constructor
Creates a RingProvider that will provide a
klass
service running onfront
, with adescription
. -
#provide ⇒ Object
Advertises this service on the primary remote TupleSpace.
Constructor Details
#initialize(klass, front, desc, renewer = nil) ⇒ RingProvider
Creates a RingProvider that will provide a klass
service running on front
, with a description
. renewer
is optional.
466 467 468 469 |
# File 'lib/rinda/ring.rb', line 466 def initialize(klass, front, desc, renewer = nil) @tuple = [:name, klass, front, desc] @renewer = renewer || Rinda::SimpleRenewer.new end |
Instance Method Details
#provide ⇒ Object
Advertises this service on the primary remote TupleSpace.
474 475 476 477 |
# File 'lib/rinda/ring.rb', line 474 def provide ts = Rinda::RingFinger.primary ts.write(@tuple, @renewer) end |