go-redis icon indicating copy to clipboard operation
go-redis copied to clipboard

feat: support set hooks option in new client API

Open zcong1993 opened this issue 1 year ago • 1 comments

https://github.com/redis/go-redis/issues/2557 go-redis v9 AddHook API cause data race issue.

This pr allow users set hooks in options for NewClient APIs, this will not cause data race. And IMO in most cases, users only need to set up hooks when initialize the client like grpc Dial(WithUnaryInterceptor()), and not need to add hooks dynamically at runtime with AddHook.

fix #2557

zcong1993 avatar Oct 11 '23 16:10 zcong1993

@zcong1993 Could you please add tests for this issue? This will allow us to continue monitoring it in the future.

ofekshenawa avatar Dec 17 '23 10:12 ofekshenawa