Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

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.

Awesome Lists containing this project

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
}
```