Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > d7dae70914f5be30a994ebbf60c8cd53 > files > 5

perl-Net-OpenDHT-0.330.0-1mdv2010.0.noarch.rpm

NAME
    Net::OpenDHT - Access the Open Distributed Hash Table (Open DHT)

SYNOPSIS
      my $dht = Net::OpenDHT->new();
      $dht->application("My Application");
      $dht->server($server); # see below

      $dht->put($key, $value, $ttl);
      my $value  = $dht->fetch($key);
      my @values = $dht->fetch($key);

DESCRIPTION
    The Net::OpenDHT module provides a simple interface to the Open DHT
    service. Open DHT is a publicly accessible distributed hash table (DHT)
    service. In contrast to the usual DHT model, clients of Open DHT do not
    need to run a DHT node in order to use the service. Instead, they can
    issue put and get operations to any DHT node, which processes the
    operations on their behalf. No credentials or accounts are required to
    use the service, and the available storage is fairly shared across all
    active clients.

    This service model of DHT usage greatly simplifies deploying client
    applications. By using Open DHT as a highly-available naming and storage
    service, clients can ignore the complexities of deploying and
    maintaining a DHT and instead concentrate on developing more
    sophisticated distributed applications.

    What this essentially gives you as a Perl author is robust storage for a
    small amount of data. This can be used as a distributed cache or data
    store.

    Read the following for full semantics about the Open DHT:

      http://opendht.org/users-guide.html

METHODS
  new
    The constructor:

      my $dht = Net::OpenDHT->new();

  application
    The application method sets the name of the application. You should set
    this as a courtesy to the Open DHT developers:

      $dht->application("My Application");

  fetch
    The get method fetches data from the Open DHT. Note that multiple values
    can be set for a key:

      my $value  = $dht->fetch($key);
      my @values = $dht->fetch($key);

  put
    The put method puts data into the Open DHT. The key has a maximum length
    of 20 bytes, the value a maximum length of 1024 bytes. You must also
    pass in a time to live in seconds:

      $dht->put($key, $value, $ttl);

  server
    The module automatically finds a topologically-close gateway to the DHT.
    It will initially start up slowly as it tries to discover a fast gateway
    but this information will be cached for a day (or until the current
    server stops responding, in which case a new server will be found). You
    may override this and provide your own gateway with this method:

      $dht->server($server);

AUTHOR
    Leon Brocard <acme@astray.com>.

COPYRIGHT
    Copyright (C) 2005, Leon Brocard

    This module is free software; you can redistribute it or modify it under
    the same terms as Perl itself.