libkv icon indicating copy to clipboard operation
libkv copied to clipboard

Lock() of Locker interface should probably take a receive-only channel

Open debedb opened this issue 8 years ago • 0 comments

Lock() of Locker interface should probably take a receive-only channel for stopChan, that is, instead of

Lock(stopChan chan struct{}) (<-chan struct{}, error)

have

Lock(<-stopChan chan struct{}) (<-chan struct{}, error)

Lock would not be writing to stopChan, the user of the Lock will - and this signature will allow using things like Context's Done channel directly (without mediating it with another select).

debedb avatar Aug 03 '17 17:08 debedb