gomodule / redigo

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

feat: add RequestContext to PubSubConn #603

Closed pabigot closed 2 years ago

pabigot commented 2 years ago

Add a wrapper that goes through the standard receiveInternal processing to match the API of the existing PubSubConn Receive methods.

Fixes: #592

pabigot commented 2 years ago

It doesn't seem that the design intent is to limit the features of PubSubConn, but an alternative approach that's only slightly less ideal would be to expose pubsub/receiveInternal as a visible, documented reply helper so we could do:

v := redis.PubSubReply(redis.ReceiveContext(c, ctx))

That might be useful anyway.

stevenh commented 2 years ago

Thanks for the PR