-
-
Notifications
You must be signed in to change notification settings - Fork 51
Extending StreamingClient without rewriting Factory #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
@dmarkic Thanks for bringing up this idea. I'm not sure I follow what exactly you're trying to achieve with this method, perhaps you can elaborate on what you're trying to build with this hypothetical API? Why do you need a custom |
@clue For instance, I want Hope this makes sense. Kind regards, |
@dmarkic I understand where you're coming from and agree that there's value in having native assoc array types (see #17 and others). Unfortunately, the suggested API would break the LSP (the L in SOLID) as your class would provide a different API than the interface. With Redis 6 as discussed in #98, the client will have native assoc array support anyway, so this will very likely introduce a BC break anyway. As such, I'm not sure how much value this suggest change would bring in the meantime. |
@clue Don't know if we understand each other. The Factory would still enforce that the returned object would be a subclass of So I would just like to extend Kind regards, |
I think the suggested changes make perfect sense and we're looking into updating the API to use more idiomatic values in the upcoming version as discussed in #17 and #98. However, because it currently returns a list of Other than that, I'll assume this is resolved and will close this for now, please feel free to report back otherwise 👍 |
Hello!
How would one extend StreamingClient and use extended class without rewriting the whole Factory class?
It seems to be easy to implement the Factory in such way that it would create a custom (extended) StreamingClient by just providing the class to use (https://github.com/clue/reactphp-redis/blob/master/src/Factory.php#L69) somewhere in the Factory.
Maybe something like:
Which would override the default
Clue\React\Redis\StreamingClient
.That way we can easily use Factory and build upon (extend) StreamingClient. It just seems such a waste to rewrite (and maintain) Factory class just to change the returned StreamingClient object.
I can make PR for this if the idea is feasible.
Thanks for great software!
Cheers,
Dejan
The text was updated successfully, but these errors were encountered: