Open
Description
I think it could be cool to be able to do oneliners like this, with static methods:
if (\Dorantor\FileLock::acquire('path')){
//do work...
\Dorantor\FileLock::release('path');
}
Also fluent locking with closures:
\Dorantor\FileLock::lock('/path/file')->acquired(function(){echo("HELLO FROM LOCK!");});
\Dorantor\FileLock::lock('/path/file')->failure(function(){echo("LOCK NOT ACQUIRED!");});
\Dorantor\FileLock::lock('/path/file')->acquired(function(){echo("HELLO FROM LOCK!");})->failure(function(){echo("LOCK NOT ACQUIRED!");});
Metadata
Metadata
Assignees
Labels
No labels