gomodule / redigo

Go client for Redis
Apache License 2.0
9.76k stars 1.25k forks source link

Act subscribe immediately without receive message #636

Closed timandy closed 2 years ago

timandy commented 2 years ago

Hi , Is there a method to act subscribe immediately and receive non message? The current version of Subscribe() does not support waiting for a response from Redis.

Like:

sub := client.Subscribe(queryResp)
sub.Active()  // TODO 
ch := sub.Channel()
go func() {
    for msg := range ch {
         //do with msg
    }
} 
stevenh commented 2 years ago

Subscriptions are covered in the docs here github issues are for bugs or feature request, not usage discussions.