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

Method processPong

nats.go:4026–4039  ·  view source on GitHub ↗

processPong is used to process responses to the client's ping messages. We use pings for the flush mechanism as well.

()

Source from the content-addressed store, hash-verified

4024// processPong is used to process responses to the client's ping
4025// messages. We use pings for the flush mechanism as well.
4026func (nc *Conn) processPong() {
4027 var ch chan struct{}
4028
4029 nc.mu.Lock()
4030 if len(nc.pongs) > 0 {
4031 ch = nc.pongs[0]
4032 nc.pongs = append(nc.pongs[:0], nc.pongs[1:]...)
4033 }
4034 nc.pout = 0
4035 nc.mu.Unlock()
4036 if ch != nil {
4037 ch <- struct{}{}
4038 }
4039}
4040
4041// processOK is a placeholder for processing OK messages.
4042func (nc *Conn) processOK() {

Callers 1

parseMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected