Passing Existing Valkey Client to valkeyaside, valkeylimiter, etc #72
Replies: 1 comment
-
|
Hi @jacobdrury, Yes, the technical reason is that those specialized wrappers may require special setup. Take valkey-go/valkeyaside/aside.go Line 41 in d4865cb It needs its own
Yes, it is correct, and most wrappers will allow you to access the underlying client directly with the valkey-go/valkeyaside/aside.go Line 28 in d4865cb |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! I’ve noticed that packages like
valkeyaside,valkeylimiter, etc., create their own Valkey connections internally, rather than accepting an existing client instance. Is there a technical or architectural reason for this design choice? Would you consider supporting direct client injection in the future?I see that these packages accept a
ClientBuilder, which seems like it could be used as a workaround to pass in an existing client by ignoring the options parameter. For example:Is this an intended use case, or just a workaround?
Also, is my understanding correct that, in most cases, a single Valkey server should only have one client instance per application? I’m just starting to learn and use Valkey, so any guidance would be appreciated.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions