redis-rb / redis-client

Simple low level client for Redis 6+
MIT License
125 stars 60 forks source link

Instance-level Middleware #52

Closed gremerritt closed 2 years ago

gremerritt commented 2 years ago

Our organization currently uses a small wrapper around redis-rb which provides a few extensions (for example, blocking keys calls in production by default and some automated instrumentation and error reporting). We'd love to switch our internal usage over to this redis-client library. The current middleware interface here is really nice and seems like it will make our "plugins" much easier to manage.

However, given that we use a library built on top of the redis gem we'd also like to scope our middleware to only our wrapper so that we're not impacting any other redis clients.

I implemented support here for instance-level middlewares. Is this something you'd be open to?

casperisfine commented 2 years ago

Interesting. For context this middleware API was intended for monitoring services etc, and I explicitly didn't make it instance level to reduce the number of method calls and not impact performance too much.

But I may be open to that functionality. I'll have to give in some thoughts. In the meantime could you cleanup your git history?

gremerritt commented 2 years ago

Let me know if you have any other questions here, happy to explore other approaches.