You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have objects that work with the redis after the connection. They load their scripts.
When we disconnect and reconnect, we cannot re-load scripts without violating SRP. Since these packets should not affect the connection process in any way.
At the moment we have implemented the OnConnect function within the package. And we do where the client is created: opts.OnConnect = pkg.OnConnect.
This approach is not convenient, because we need to make wrappers if we have several OnConnects. And for other reasons.
I can make a full-fledged implementation of the observer pattern for OnConnect. This will solve all the inconveniences and the code will be cleaner.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
We have objects that work with the redis after the connection. They load their scripts.
When we disconnect and reconnect, we cannot re-load scripts without violating SRP. Since these packets should not affect the connection process in any way.
At the moment we have implemented the OnConnect function within the package. And we do where the client is created:
opts.OnConnect = pkg.OnConnect
.This approach is not convenient, because we need to make wrappers if we have several OnConnects. And for other reasons.
I can make a full-fledged implementation of the observer pattern for OnConnect. This will solve all the inconveniences and the code will be cleaner.
Do you need it?
Beta Was this translation helpful? Give feedback.
All reactions