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

Method Ping

pubsub.go:345–363  ·  view source on GitHub ↗
(ctx context.Context, payload ...string)

Source from the content-addressed store, hash-verified

343}
344
345func (c *PubSub) Ping(ctx context.Context, payload ...string) error {
346 args := []interface{}{"ping"}
347 if len(payload) == 1 {
348 args = append(args, payload[0])
349 }
350 cmd := NewCmd(ctx, args...)
351
352 c.mu.Lock()
353 defer c.mu.Unlock()
354
355 cn, err := c.conn(ctx, nil)
356 if err != nil {
357 return err
358 }
359
360 err = c.writeCmd(ctx, cn, cmd)
361 c.releaseConn(ctx, cn, err, false)
362 return err
363}
364
365// ClientSetName assigns a namee to the PubSub connection using CLIENT SETNAME,
366// The name is visible in CLIENT LIST output and is useful for debugging

Callers

nothing calls this directly

Calls 4

connMethod · 0.95
writeCmdMethod · 0.95
releaseConnMethod · 0.95
NewCmdFunction · 0.85

Tested by

no test coverage detected