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.
- Host: GitHub
- URL: https://github.com/marcopeereboom/lockfile
- Owner: marcopeereboom
- License: isc
- Created: 2015-05-28T15:45:51.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-08-16T18:30:57.000Z (about 7 years ago)
- Last Synced: 2024-07-16T14:03:10.183Z (4 months ago)
- Language: Go
- Size: 6.84 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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
}
```