MCPcopy
hub / github.com/jackc/pgx / receiveMessage

Method receiveMessage

pgconn/pgconn.go:2879–2895  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2877}
2878
2879func (p *Pipeline) receiveMessage() (pgproto3.BackendMessage, error) {
2880 for {
2881 msg, err := p.conn.receiveMessage()
2882 if err != nil {
2883 p.err = err
2884 p.conn.asyncClose()
2885 return nil, normalizeTimeoutError(p.ctx, err)
2886 }
2887
2888 switch msg := msg.(type) {
2889 case *pgproto3.ParameterStatus, *pgproto3.NoticeResponse, *pgproto3.NotificationResponse:
2890 // Filter these message types out in pipeline mode. The normal processing is handled by PgConn.receiveMessage.
2891 default:
2892 return msg, nil
2893 }
2894 }
2895}
2896
2897func (p *Pipeline) handleUnexpectedMessage(errStr string, msg pgproto3.BackendMessage) error {
2898 p.err = fmt.Errorf("pipeline: %s: received unexpected message type %T", errStr, msg)

Callers 7

getResultsPrepareMethod · 0.95
getResultsDeallocateMethod · 0.95
getResultsSyncMethod · 0.95
receiveParseCompleteMethod · 0.95
receiveBindCompleteMethod · 0.95

Calls 3

normalizeTimeoutErrorFunction · 0.85
asyncCloseMethod · 0.80
receiveMessageMethod · 0.45

Tested by

no test coverage detected