Skip to content
This repository has been archived by the owner on Feb 21, 2023. It is now read-only.

[Enhancement] Make transport pluggable #478

Closed
bmerry opened this issue Oct 12, 2018 · 0 comments
Closed

[Enhancement] Make transport pluggable #478

bmerry opened this issue Oct 12, 2018 · 0 comments
Labels
resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version.

Comments

@bmerry
Copy link
Collaborator

bmerry commented Oct 12, 2018

I'm working on a new library for mocking redis, for which I intend to provide both redis-py and aioredis integrations. The base of the library works by using a socketpair, one end of which behaves like a redis server and the other end replaces the client's normal TCP or Unix socket.

For aioredis, I've got something working but I'm having to duplicate a fair bit of code and deal with internals (more than for redis-py), because the logic to create a (reader, writer) pair is mixed in with unrelated logic about connection classes, timeout validation etc in create_connection. It would be nice if create_connection could take a factory that could turn an address into a (reader, writer) pair, similar to the way connection_cls is a factory (and obviously also pass it through from higher levels like create_redis).

I'm happy to do the work and make a PR, but wanted to file this as an issue first in case anyone has already done something like this or has thoughts on how to architect it. I've never used aioredis before today so feedback will certainly help me avoid making a mess of it.

@seandstewart seandstewart added the resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version. label Mar 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolved-via-latest This indicates this issue is either resolved or invalid as of the latest version.
Projects
None yet
Development

No branches or pull requests

2 participants