(ctx context.Context, payload ...string)
| 343 | } |
| 344 | |
| 345 | func (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 |
nothing calls this directly
no test coverage detected