1package Workflow::Persister::UUID;
2
3use warnings;
4use strict;
5use Data::UUID;
6
7$Workflow::Persister::UUID::VERSION = '1.59';
8
9sub new {
10    my ( $class, $params ) = @_;
11    my $self = bless { gen => Data::UUID->new() }, $class;
12    return $self;
13}
14
15sub pre_fetch_id {
16    my ( $self, $dbh ) = @_;
17    return $self->{gen}->create_str();
18}
19
20sub post_fetch_id {return}
21
221;
23
24__END__
25
26=pod
27
28=head1 NAME
29
30Workflow::Persister::UUID - Persister to generate Universally Unique Identifiers
31
32=head1 VERSION
33
34This documentation describes version 1.59 of this package
35
36=head1 SYNOPSIS
37
38 <persister
39     name="MyPersister"
40     use_uuid="yes"
41 ...
42
43=head1 DESCRIPTION
44
45Implementation for any persister to generate a UUID/GUID ID
46string. The resulting string is 36 characters long and, according to
47the implementation docs, "is guaranteed to be different from all other
48UUIDs/GUIDs generated until 3400 CE."
49
50This uses the L<Data::UUID> module to generate the UUID string, so
51look there if you are curious about the algorithm, efficiency, etc.
52
53=head2 METHODS
54
55=head3 new
56
57Instantiates a Workflow::Persister::UUID object, which is actually an
58encapsulation of L<Data::UUID>.
59
60=head3 pre_fetch_id
61
62L</pre_fetch_id> can then be used to generate/retrieve a unique ID, generated
63by L<Data::UUID>.
64
65=head3 post_fetch_id
66
67This method is unimplemented at this time, please see the TODO.
68
69=head1 TODO
70
71=over
72
73=item * Implement L</post_fetch_id>
74
75=back
76
77=head1 SEE ALSO
78
79=over
80
81=item L<Data::UUID>
82
83=back
84
85=head1 COPYRIGHT
86
87Copyright (c) 2003-2022 Chris Winters. All rights reserved.
88
89This library is free software; you can redistribute it and/or modify
90it under the same terms as Perl itself.
91
92Please see the F<LICENSE>
93
94=head1 AUTHORS
95
96Please see L<Workflow>
97
98=cut
99