MCPcopy
hub / github.com/etcd-io/etcd / waitSession

Method waitSession

client/v3/leasing/kv.go:449–461  ·  view source on GitHub ↗
(ctx context.Context)

Source from the content-addressed store, hash-verified

447}
448
449func (lkv *leasingKV) waitSession(ctx context.Context) error {
450 lkv.leases.mu.RLock()
451 sessionc := lkv.sessionc
452 lkv.leases.mu.RUnlock()
453 select {
454 case <-sessionc:
455 return nil
456 case <-lkv.ctx.Done():
457 return lkv.ctx.Err()
458 case <-ctx.Done():
459 return ctx.Err()
460 }
461}
462
463func (lkv *leasingKV) readySession() bool {
464 lkv.leases.mu.RLock()

Callers 5

NewKVFunction · 0.95
putMethod · 0.95
acquireMethod · 0.95
deleteMethod · 0.95
serverTxnMethod · 0.80

Calls 4

RLockMethod · 0.65
RUnlockMethod · 0.65
DoneMethod · 0.65
ErrMethod · 0.45

Tested by

no test coverage detected