The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Prty::LockedCounter - Persistenter Zähler mit Lock

BASE CLASS

Prty::Object

SYNOPSIS

    use Prty::LockedCounter;
    
    $cnt = Prty::LockedCounter->new($file)->increment;
    ...
    $n = $cnt->count;

DESCRIPTION

Die Klasse realisiert einen Zähler mit Exklusiv-Lock. Der Zählerstand wird in einer Datei gespeichert. Die Datei wird gelockt. Der Lock wird bis zur Destrukturierung des Objekts gehalten.

METHODS

Konstruktor

new() - Instantiiere Counter

Synopsis

    $ctr = Prty::LockedCounter->new($file);

Returns

Objekt

Operationen

count() - Liefere Zählerstand

Synopsis

    $n = $ctr->count;

Returns

Zählerstand (Integer)

file() - Liefere Dateipfad

Synopsis

    $file = $ctr->file;

Returns

Dateipfad (String)

increment() - Inkrementiere Zählerstand

Synopsis

    $ctr = $ctr->increment;

Returns

Objekt

VERSION

1.124

AUTHOR

Frank Seitz, http://fseitz.de/

COPYRIGHT

Copyright (C) 2018 Frank Seitz

LICENSE

This code is free software; you can redistribute it and/or modify it under the same terms as Perl itself.