Skip to content

Static version of the library and other things? #4

Open
@beppe9000

Description

@beppe9000

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions