DynGig-Util

 view release on metacpan or  search on metacpan

lib/DynGig/Util/EZDB.pm  view on Meta::CPAN

263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
    my $handle = $this->{sth};
 
    return unless $table && $handle->{$table};
 
    my ( $sth, $result ) = $handle->{$table}{$name};
 
    while ( $sth )
    {  
        $result = eval { $sth->execute( @_ ) };
        last unless $@;
        croak $@ if $@ !~ /locked/;
    }
 
    return $result, $sth;
}
 
=head1 SEE ALSO
 
DBI
 
=head1 NOTE

lib/DynGig/Util/LockFile/PID.pm  view on Meta::CPAN

100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
    my $this = shift;
    my $handle = $$this;
 
    sysseek $handle, 0, 0;
    return $handle;
}
 
=head2 check( $filename )
 
Returns ID of process that owns the lock. Returns 0 if not locked.
 
=cut
sub check
{
    my ( $class, $file ) = @_;
 
    croak 'lock file not defined' unless defined $file;
 
    my ( $handle, $pid );

lib/DynGig/Util/LockFile/Time.pm  view on Meta::CPAN

15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
use constant { DURATION => 3600 * 12 };
 
=head1 SYNOPSIS
 
 use DynGig::Util::LockFile::Time;
  
 my $lock = '/lock/file/path';
 
 DynGig::Util::LockFile::Time->lock( $lock, epoch => 3600, duration => 1200 );
 
 die "locked\n" if my $seconds = DynGig::Util::LockFile::Time->check( $lock );
 
=head1 DESCRIPTION
 
=head2 lock( file, epoch => start, duration => seconds )
 
Writes time into the file.
 
=cut
sub lock
{



( run in 0.252 second using v1.01-cache-2.11-cpan-55f5a4728d2 )