MCPcopy
hub / github.com/redis/go-redis / pipelineProcessCmds

Method pipelineProcessCmds

redis.go:1212–1235  ·  redis.go::baseClient.pipelineProcessCmds
(
	ctx context.Context, cn *pool.Conn, cmds []Cmder,
)

Source from the content-addressed store, hash-verified

1210}
1211
1212func (c *baseClient) pipelineProcessCmds(
1213 ctx context.Context, cn *pool.Conn, cmds []Cmder,
1214) (bool, error) {
1215 // Process any pending push notifications before executing the pipeline
1216 if err := c.processPushNotifications(ctx, cn); err != nil {
1217 internal.Logger.Printf(ctx, "push: error processing pending notifications before writing pipeline: %v", err)
1218 }
1219
1220 if err := cn.WithWriter(c.context(ctx), c.opt.WriteTimeout, func(wr *proto.Writer) error {
1221 return writeCmds(wr, cmds)
1222 }); err != nil {
1223 setCmdsErr(cmds, err)
1224 return true, err
1225 }
1226
1227 if err := cn.WithReader(c.context(ctx), c.opt.ReadTimeout, func(rd *proto.Reader) error {
1228 // read all replies
1229 return c.pipelineReadCmds(ctx, cn, rd, cmds)
1230 }); err != nil {
1231 return true, err
1232 }
1233
1234 return false, nil
1235}
1236
1237func (c *baseClient) pipelineReadCmds(ctx context.Context, cn *pool.Conn, rd *proto.Reader, cmds []Cmder) error {
1238 for i, cmd := range cmds {

Callers

nothing calls this directly

Calls 8

contextMethod · 0.95
pipelineReadCmdsMethod · 0.95
writeCmdsFunction · 0.85
setCmdsErrFunction · 0.85
WithWriterMethod · 0.80
WithReaderMethod · 0.80
PrintfMethod · 0.65

Tested by

no test coverage detected