Skip to content

Extending StreamingClient without rewriting Factory #103

Closed
@dmarkic

Description

@dmarkic

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:

$factory->setClientClass(...);

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions