Data::YUID::Client - Client for distributed YUID generation
use Data::YUID::Client; my $client = Data::YUID::Client->new( servers => [ '192.168.100.4:11001', '192.168.100.5:11001', ], ); my $id = $client->get_id;
Data::YUID::Client is a client for the client/server protocol used to generate distributed unique IDs. bin/yuidd implements the server portion of the protocol.
Creates a new client object, initialized with %param, and returns the new object.
%param can contain:
A reference to a list of server addresses, in host:port notation. These should point to the locations of servers running the yuidd server using the client/server protocol for ID generation.
New Behavior: the original version of this would create a connection to every server at
new() and cache them all. This version creates only one connection, when the first YUID is requested, and caches that connection. If the connection goes bad, it'll try other servers it its list until one works or until it has worked through the list.
Obtains a unique ID from one of the servers, in the optional namespace $namespace.
Returns undef if it can't get an ID from any server.
Please see the Data::YUID manpage for author, copyright, and license information.