Workflow::Persister::UUID - Persister to generate Universally Unique Identifiers


Workflow documentation Contained in the Workflow distribution.

Index


Code Index:

NAME

Top

Workflow::Persister::UUID - Persister to generate Universally Unique Identifiers

VERSION

Top

This documentation describes version 1.03 of this package

SYNOPSIS

Top

 <persister
     name="MyPersister"
     use_uuid="yes"
 ...

DESCRIPTION

Top

Implementation for any persister to generate a UUID/GUID ID string. The resulting string is 36 characters long and, according to the implementation docs, "is guaranteed to be different from all other UUIDs/GUIDs generated until 3400 CE."

This uses the Data::UUID module to generate the UUID string, so look there if you are curious about the algorithm, efficiency, etc.

METHODS

new

Instantiates a Workflow::Persister::UUID object, which is actually an encapsulation of Data::UUID.

pre_fetch_id

pre_fetch_id can then be used to generate/retrieve a unique ID, generated by Data::UUID.

post_fetch_id

This method is unimplemented at this time, please see the TODO.

TODO

Top

* Implement post_fetch_id

SEE ALSO

Top

Data::UUID

COPYRIGHT

Top

AUTHORS

Top

Chris Winters <chris@cwinters.com>


Workflow documentation Contained in the Workflow distribution.

package Workflow::Persister::UUID;

# $Id: UUID.pm 454 2009-01-12 10:04:02Z jonasbn $

use warnings;
use strict;
use Data::UUID;

$Workflow::Persister::UUID::VERSION = '1.03';

sub new {
    my ( $class, $params ) = @_;
    my $self = bless { gen => Data::UUID->new() }, $class;
    return $self;
}

sub pre_fetch_id {
    my ( $self, $dbh ) = @_;
    return $self->{gen}->create_str();
}

sub post_fetch_id {return}

1;

__END__