mirror of https://github.com/status-im/consul.git
api: Make channels receive only
This commit is contained in:
parent
e9216fa47d
commit
4fef14163d
|
@ -103,7 +103,7 @@ func (c *Client) LockOpts(opts *LockOptions) (*Lock, error) {
|
||||||
// created without any associated health checks. By default Consul sessions
|
// created without any associated health checks. By default Consul sessions
|
||||||
// prefer liveness over safety and an application must be able to handle
|
// prefer liveness over safety and an application must be able to handle
|
||||||
// the lock being lost.
|
// the lock being lost.
|
||||||
func (l *Lock) Lock(stopCh chan struct{}) (chan struct{}, error) {
|
func (l *Lock) Lock(stopCh <-chan struct{}) (<-chan struct{}, error) {
|
||||||
// Hold the lock as we try to acquire
|
// Hold the lock as we try to acquire
|
||||||
l.l.Lock()
|
l.l.Lock()
|
||||||
defer l.l.Unlock()
|
defer l.l.Unlock()
|
||||||
|
|
|
@ -128,7 +128,7 @@ func (c *Client) SemaphoreOpts(opts *SemaphoreOptions) (*Semaphore, error) {
|
||||||
// created without any associated health checks. By default Consul sessions
|
// created without any associated health checks. By default Consul sessions
|
||||||
// prefer liveness over safety and an application must be able to handle
|
// prefer liveness over safety and an application must be able to handle
|
||||||
// the session being lost.
|
// the session being lost.
|
||||||
func (s *Semaphore) Acquire(stopCh chan struct{}) (chan struct{}, error) {
|
func (s *Semaphore) Acquire(stopCh <-chan struct{}) (<-chan struct{}, error) {
|
||||||
// Hold the lock as we try to acquire
|
// Hold the lock as we try to acquire
|
||||||
s.l.Lock()
|
s.l.Lock()
|
||||||
defer s.l.Unlock()
|
defer s.l.Unlock()
|
||||||
|
|
Loading…
Reference in New Issue