An “indexed” set. All items must respond to :ident.
Indicates a failure to resolve a name or address.
Indicates a timeout resolving a name or address.
Wrapper class. Use this class to access the XPath
functions.
@private
Rinda
error base class
Raised when trying to use a canceled tuple.
Raised when trying to use an expired tuple.
TupleSpaceProxy
allows a remote Tuplespace to appear as local.
RingFinger
is used by RingServer
clients to discover the RingServer’s TupleSpace
. Typically, all a client needs to do is call RingFinger.primary
to retrieve the remote TupleSpace
, which it can then begin using.
To find the first available remote TupleSpace:
Rinda::RingFinger.primary
To create a RingFinger
that broadcasts to a custom list:
rf = Rinda::RingFinger.new ['localhost', '192.0.2.1'] rf.primary
Rinda::RingFinger
also understands multicast addresses and sets them up properly. This allows you to run multiple RingServers on the same host:
rf = Rinda::RingFinger.new ['239.0.0.1'] rf.primary
You can set the hop count (or TTL) for multicast searches using multicast_hops
.
If you use IPv6 multicast you may need to set both an address and the outbound interface index:
rf = Rinda::RingFinger.new ['ff02::1'] rf.multicast_interface = 1 rf.primary
At this time there is no easy way to get an interface index by name.
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].
A NotifyTemplateEntry
is returned by TupleSpace#notify
and is notified of TupleSpace
changes. You may receive either your subscribed event or the ‘close’ event when iterating over notifications.
See TupleSpace#notify_event
for valid notification types.
ts = Rinda::TupleSpace.new observer = ts.notify 'write', [nil] Thread.start do observer.each { |t| p t } end 3.times { |i| ts.write [i] }
Outputs:
['write', [0]] ['write', [1]] ['write', [2]]
The Tuplespace manages access to the tuples it contains, ensuring mutual exclusion requirements are met.
The sec
option for the write, take, move, read and notify methods may either be a number of seconds or a Renewer object.
RSS
2.0 support RSS
has three different versions. This module contains support for version 2.0
RSS
2.0 Producing our own RSS
feeds is easy as well. Let’s make a very basic feed:
require "rss" rss = RSS::Maker.make("2.0") do |maker| maker.channel.language = "en" maker.channel.author = "matz" maker.channel.updated = Time.now.to_s maker.channel.link = "http://www.ruby-lang.org/en/feeds/news.rss" maker.channel.title = "Example Feed" maker.channel.description = "A longer description of my feed." maker.items.new_item do |item| item.link = "http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/" item.title = "Ruby 1.9.2-p136 is released" item.updated = Time.now.to_s end end puts rss
As you can see, this is a very Builder-like DSL. This code will spit out an RSS
2.0 feed with one item. If we needed a second item, we’d make another block with maker.items.new_item and build a second one.