Represents a tagged XML
element. Elements
are characterized by having children, attributes, and names, and can themselves be children.
A class which provides filtering of children for Elements
, and XPath
search support. You are expected to only encounter this class as the element.elements
object. Therefore, you are not expected to instantiate this yourself.
A parent has children, and has methods for accessing them. The Parent
class is never encountered except as the superclass for some other object.
Templates are used to match tuples in Rinda
.
Documentation?
An SimpleRenewer
allows a TupleSpace
to check if a TupleEntry
is still alive.
A RingServer
allows a Rinda::TupleSpace
to be located via UDP broadcasts. Default service location uses the following steps:
A RingServer
begins listening on the network broadcast UDP address.
A RingFinger
sends a UDP packet containing the DRb
URI
where it will listen for a reply.
The RingServer
receives the UDP packet and connects back to the provided DRb
URI
with the DRb
service.
A RingServer
requires a TupleSpace:
ts = Rinda::TupleSpace.new rs = Rinda::RingServer.new
RingServer
can also listen on multicast addresses for announcements. This allows multiple RingServers to run on the same host. To use network broadcast and multicast:
ts = Rinda::TupleSpace.new rs = Rinda::RingServer.new ts, %w[Socket::INADDR_ANY, 239.0.0.1 ff02::1]
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 TemplateEntry
is a Template
together with expiry and cancellation data.
Documentation?
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]]
An error that indicates we weren’t able to fetch some data from a source
Run an instance of the gem program.
Gem::GemRunner
is only intended for internal use by RubyGems itself. It does not form any public API and may change at any time for any reason.
If you would like to duplicate functionality of ‘gem` commands, use the classes they call directly.
Gem::Server
and allows users to serve gems for consumption by ‘gem –remote-install`.
gem_server starts an HTTP server on the given port and serves the following:
“/” - Browsing of gem spec files for installed gems
“/specs.#{Gem.marshal_version}.gz” - specs name/version/platform index
“/latest_specs.#{Gem.marshal_version}.gz” - latest specs name/version/platform index
“/quick/” - Individual gemspecs
“/gems” - Direct access to download the installable gems
“/rdoc?q=” - Search for installed rdoc documentation
gem_server = Gem::Server.new Gem.dir, 8089, false gem_server.run
RefError
is raised when a referenced object has been recycled by the garbage collector
An HTTP Proxy server which proxies GET, HEAD and POST requests.
To create a simple proxy server:
require 'webrick' require 'webrick/httpproxy' proxy = WEBrick::HTTPProxyServer.new Port: 8000 trap 'INT' do proxy.shutdown end trap 'TERM' do proxy.shutdown end proxy.start
See ::new
for proxy-specific configuration items.
To modify content the proxy server returns use the :ProxyContentHandler
option:
handler = proc do |req, res| if res['content-type'] == 'text/plain' then res.body << "\nThis content was proxied!\n" end end proxy = WEBrick::HTTPProxyServer.new Port: 8000, ProxyContentHandler: handler
An HTTP Server
Base server class
Base TCP server class. You must subclass GenericServer
and provide a run
method.
exception to wait for reading. see IO.select
.