docker / libkv

Distributed key/value store abstraction library
Apache License 2.0
854 stars 205 forks source link

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

Open debedb opened 7 years ago

debedb commented 7 years ago

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).