sorccu / r2d2-redis

MIT License
101 stars 42 forks source link

update valid/broken logic to hybrid approach #22

Closed coder543 closed 5 years ago

coder543 commented 5 years ago

update valid/broken logic to hybrid approach

After discussing this with some other people, it sounds like the r2d2 checkout logic is supposed to be more "active" in validating the connection than simply checking the connection state, so I propose using this hybrid approach.

@badboy do you have any thoughts on how involved the validation logic for checking out a connection from the connection pool should be? I appreciated your responsiveness on merging my previous PR.

badboy commented 5 years ago

Hm, the docs specifically say that the is_valid check would do a simple query and the has_broken should be fast, thus I'm fine with your changes now.

badboy commented 5 years ago

(the r2d2 docs I mean)