Closed jkrems closed 8 years ago
LGTM.
Adding timeout logic like this always makes me nervous that it will work fine in simple test cases but behavior weirdly under high load/concurrency. But I guess the only way to verify that is to test it under high load :)
Yeah, I have similar concerns. But I think because the actual sockets aren't opened per command but via a central pool, letting them "hang" shouldn't lead to resource exhaustion. Hopefully. ^^
There are a couple of potential improvements that I didn't include in here, such as:
gofer
-likeglobalDefaults
setting that applies to all cachesgofer
-like default timeout so cache calls never have no timeout at allThe latter would be a breaking change, so I kept it to the bare minimum.