MCPcopy
hub / github.com/nats-io/nats.go / Buffered

Method Buffered

nats.go:5861–5868  ·  view source on GitHub ↗

Buffered will return the number of bytes buffered to be sent to the server. FIXME(dlc) take into account disconnected state.

()

Source from the content-addressed store, hash-verified

5859// Buffered will return the number of bytes buffered to be sent to the server.
5860// FIXME(dlc) take into account disconnected state.
5861func (nc *Conn) Buffered() (int, error) {
5862 nc.mu.RLock()
5863 defer nc.mu.RUnlock()
5864 if nc.isClosed() || nc.bw == nil {
5865 return -1, ErrConnectionClosed
5866 }
5867 return nc.bw.buffered(), nil
5868}
5869
5870// resendSubscriptions will send our subscription state back to the
5871// server. Used in reconnects

Callers 4

wsInitHandshakeMethod · 0.80
TestReconnectBufSizeFunction · 0.80
TestFlushFunction · 0.80

Calls 2

isClosedMethod · 0.95
bufferedMethod · 0.80

Tested by 3

TestReconnectBufSizeFunction · 0.64
TestFlushFunction · 0.64