go-redis
go-redis copied to clipboard
feat: support set hooks option in new client API
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 Could you please add tests for this issue? This will allow us to continue monitoring it in the future.