MCPcopy
hub / github.com/grpc/grpc-go / getOnceLocked

Method getOnceLocked

internal/transport/controlbuf.go:431–449  ·  view source on GitHub ↗

Callers must not use this method, but should instead use get(). Caller must hold c.mu.

()

Source from the content-addressed store, hash-verified

429//
430// Caller must hold c.mu.
431func (c *controlBuffer) getOnceLocked() (any, error) {
432 if c.closed {
433 return false, ErrConnClosing
434 }
435 if c.list.isEmpty() {
436 return nil, nil
437 }
438 h := c.list.dequeue().(cbItem)
439 if h.isTransportResponseFrame() {
440 if c.transportResponseFrames == maxQueuedTransportResponseFrames {
441 // We are removing the frame that put us over the
442 // threshold; close and clear the throttling channel.
443 ch := c.trfChan.Swap(nil)
444 close(*ch)
445 }
446 c.transportResponseFrames--
447 }
448 return h, nil
449}
450
451// finish closes the control buffer, cleaning up any streams that have queued
452// header frames. Once this method returns, no more frames can be added to the

Callers 1

getMethod · 0.95

Calls 4

isEmptyMethod · 0.45
dequeueMethod · 0.45
SwapMethod · 0.45

Tested by

no test coverage detected