1
0
mirror of https://github.com/danog/file.git synced 2024-12-02 09:17:57 +01:00
This commit is contained in:
Daniil Gentili 2024-09-02 16:48:40 +02:00
parent 8041a2b428
commit 4b234c63a3
4 changed files with 16 additions and 14 deletions

View File

@ -10,10 +10,10 @@ use function Amp\delay;
/**
* Async mutex based on files.
*
* A crash of the program will NOT release the lock, manual user action will be required to remove the lockfile.
*
* For a mutex that will automatically release the lock in case of a crash, see LockingFileMutex.
*
* A crash of the program will NOT release the lock, manual user action will be required to remove the lockfile.
*
* For a mutex that will automatically release the lock in case of a crash, see LockingFileMutex.
*/
final class FileMutex implements Mutex
{

View File

@ -7,12 +7,13 @@ use Amp\Sync\KeyedMutex;
use Amp\Sync\Lock;
use Amp\Sync\SyncException;
use function Amp\delay;
/**
* Asynckeyed mutex based on files.
*
* A crash of the program will NOT release the lock, manual user action will be required to remove the lockfile.
*
* For a mutex that will automatically release the lock in case of a crash, see KeyedLockingFileMutex.
*
* A crash of the program will NOT release the lock, manual user action will be required to remove the lockfile.
*
* For a mutex that will automatically release the lock in case of a crash, see KeyedLockingFileMutex.
*/
final class KeyedFileMutex implements KeyedMutex
{

View File

@ -7,11 +7,12 @@ use Amp\Sync\KeyedMutex;
use Amp\Sync\Lock;
use Amp\Sync\SyncException;
use function Amp\delay;
/**
* Async keyed mutex based on flock.
*
* A crash of the program will automatically release the lock, but the lockfiles will never be removed from the filesystem (even in case of successful release).
*
*
* A crash of the program will automatically release the lock, but the lockfiles will never be removed from the filesystem (even in case of successful release).
*
* For a mutex that removes the lockfiles but does not release the lock in case of a crash (requiring manual user action to clean up), see KeyedFileMutex.
*/

View File

@ -10,9 +10,9 @@ use function Amp\delay;
/**
* Async mutex based on flock.
*
* A crash of the program will automatically release the lock, but the lockfiles will never be removed from the filesystem (even in case of successful release).
*
*
* A crash of the program will automatically release the lock, but the lockfiles will never be removed from the filesystem (even in case of successful release).
*
* For a mutex that removes the lockfiles but does not release the lock in case of a crash (requiring manual user action to clean up), see FileMutex.
*/
final class LockingFileMutex implements Mutex