Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

https://github.com/marcopeereboom/lockfile

go package that manages filesystem locks.
https://github.com/marcopeereboom/lockfile

Last synced: 3 months ago
JSON representation

go package that manages filesystem locks.

Lists

README

        

# lockfile - package that manages filesystem locks.

The lockfile package uses the filesystem to serialize cooperative processes.
Additionally it provides single process serialization.

Typical usage:
```Go
// Create lock
l, err := New(lockfile, 100*time.Millisecond)
if err != nil {
return err
}

...

// Lock something
err = l.Lock(5*time.Second)
if err != nil {
return err
}

...

// And unlock it
err = l.Unlock()
if err != nil {
return err
}
```