Skip to content

redis.Redis didn't implement redisNode interface  #5175

@yanrongliang

Description

@yanrongliang

Describe the bug
我需要使用BlpopCtx来消费list,发现redis.Redis无法作为BlpopCtx的参数RedisNode, 通过goland查看是redis.Redis没有实现部分方法

To Reproduce

  1. The code is
 node1, _ := redis.NewRedis(&redis.RedisConf{})
node2, _ := redis.NewRedis(&redis.RedisConf{})
node1.BlpopCtx(ctx, node2, "")
  1. The error is

    Cannot use node (type *Redis) as the type RedisNode
    

Type does not implement RedisNode as some methods are missing:
Pipeline() Pipeliner
TxPipelined(ctx context.Context, fn func(Pipeliner) error) ([]Cmder, error)
Command(ctx context.Context) *CommandsInfoCmd


**Expected behavior**
node2可以作为BlpopCtx的第二个参数

**Screenshots**

https://github.com/user-attachments/assets/4c095d9c-232c-4460-8218-f0e70364ea2b

**Environments (please complete the following information):**
 - OS: [macos]
 - go-zero version [v1.9.0]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions