Keith Wang > DynGig-Range-Cluster-0.03 > DynGig::Range::Cluster::Client

Download:
DynGig-Range-Cluster-0.03.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Source  

NAME ^

DynGig::Range::Cluster::Client - Cluster client

SYNOPSIS ^

 ## a network client
 my $client1 = DynGig::Range::Cluster::Client->new
 ( 
     server => 'localhost:12345',
     timeout => 10
 );

 ## a Unix domain socket client
 my $client2 = DynGig::Range::Cluster::Client->new
 (
     server => '/unix/domain/socket'
     timeout => 20
 );

 ...

 ## write cache
 $client1->cache( cache => '/cache/dir' );

 ## refresh data
 $client2->update();
 
 ## get the value of node 'foo' for cluster 'c1'
 my $value = $client2->node( cluster => 'c1', key => 'foo' );

 ## get the nodes for cluster 'c1' where the value is 'DOWN'
 my $keys = $client2->node( cluster => 'c1', value => 'DOWN' );

 ## get all cluster names where the attr key is 'foo' and value is 'bar'
 my $clusters = $client2->attr( key => 'foo', value => 'bar' );

METHODS ^

update()

Returns true if successful, false otherwise.

cache( cache => dir )

Writes config to the cache directory. Sets current symlink to the latest cache file. Returns the object.

Autoloaded Methods $attribute( %query )

See DynGig::Range::Cluster::Config

NOTE ^

See DynGig::Range::Cluster

syntax highlighting: