add state.Locker interface

Changed from state.StateLocker to remove the stutter.

State implementations can provide Lock/Unlock methods to lock the state
file. Remote clients can also provide these same methods, which will be
called through remote.State.
This commit is contained in:
James Bardin 2017-01-09 18:00:05 -05:00
parent be9fc64967
commit cc0712edab
1 changed files with 6 additions and 0 deletions

View File

@ -40,3 +40,9 @@ type StateRefresher interface {
type StatePersister interface {
PersistState() error
}
// Locker is implemented to lock state during command execution.
type Locker interface {
Lock(reason string) error
Unlock() error
}